Tim Franklin <> wrote on Tuesday, June 17, 2008 12:05 PM: > 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.
when using pattern recalls (i.e. \1,...), please check the DDTS mentioned in http://www.cisco.com/warp/public/707/cisco-sr-20070912-regexp.shtml as they could lead to a stack overflow.. oli _______________________________________________ cisco-nsp mailing list [email protected] https://puck.nether.net/mailman/listinfo/cisco-nsp archive at http://puck.nether.net/pipermail/cisco-nsp/
