[c-nsp] cisco regex puzzle of the day

Saku Ytti saku at ytti.fi
Wed Mar 11 12:38:13 EDT 2015


On (2015-03-10 20:29 +0100), Job Snijders wrote:

>     "^64500+ [^64500]"
> 
> This junos beauty will match for example: "64500 64500 123 123 444", but
> not "64500 64500" or "64500".
> 
> Can any of you come up with a single line regex that works on IOS or XR
> (ios-regex) to mimick the above described behaviour?

Follow-up question. Is there use-case for regular expression backtracking in
AS_PATH?
It would be simpler to implement without backtracking and it would fix this
specific use-case, as simple '(64500_)+.+' would work. But perhaps it's still
stupid idea, perhaps it'll break lot of really common use-cases.

-- 
  ++ytti


More information about the cisco-nsp mailing list