[j-nsp] Back-reference in JunOS regular expressions

Jonathan Lassoff jof at thejof.com
Thu Jul 14 03:00:46 EDT 2011


On Wed, Jul 13, 2011 at 11:02 PM, Michael Hallgren <m.hallgren at free.fr> wrote:
> Le mercredi 13 juillet 2011 à 18:25 +0200, Daniel Verlouw a écrit :
>> see
>> <https://puck.nether.net/pipermail/juniper-nsp/2010-July/017473.html>
>>
>> Not supported. I requested an ER back then, don't think it ever got
>> implemented...
>
> Thanks Daniel, I'll do the same then... Must be considered pretty basic
> from a regexp point of view, I think. Right? :)

>From a user and standardization perspective, they seem pretty simple,
but are actually difficult to implement very efficiently since the
time it takes to do the search is non-deterministic.

Here's a nice accessible write-up about DFA vs NFA regex engines that
touches on this: http://swtch.com/~rsc/regexp/regexp1.html

Honestly, what's the use case of a backreference for an AS path? It
seems like BGP loop detection would never allow a path like "A X X A",
in which case if it's just used to search for repetition (as mentioned
above), why not just use the "+" and "*" operators? e.g. "^(701 )+"

Cheers,
jof



More information about the juniper-nsp mailing list