[c-nsp] Expression to match 1, 2, or 3 AS paths

Diogo Montagner diogo.montagner at gmail.com
Tue Jun 17 07:36:48 EDT 2008


Thanks for all!

Regards,
./diogo -montagner


On Tue, Jun 17, 2008 at 7:04 AM, Tim Franklin <tim at pelican.org> wrote:
> On Sat, June 14, 2008 5:08 am, Diogo Montagner wrote:
>
>> Some days ago I was trying to identify prepends using regular
>> expressions without knowing the AS.
>
> You can do this with regexp back-references.
>
> ([0-9]+)(_\1)+
>
> will match any AS that's prepended at least once, and
>
> ([0-9]+)(_\1)*
>
> will match the same AS any number of times.  You could use explicit
> repetitions of '_\1' if you want to match a specific number of prepends.
>
> Regards,
> Tim.
>
>
>


More information about the cisco-nsp mailing list