[c-nsp] cisco regex puzzle of the day
Saku Ytti
saku at ytti.fi
Wed Mar 11 12:57:45 EDT 2015
> 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.
Answering to myself, it's terrible idea ^.*64500$ wouldn't work, as .* would
eat all characters and 64500 wouldn't be left so it would never match.
It would have to forbid backtracking per-match basis, so you could add
qualifier to +*? to tell them if backtracking is forbidden.
--
++ytti
More information about the cisco-nsp
mailing list