[c-nsp] REGEX tool?

William F. Maton Sotomayor wmaton at ottix.net
Tue Jun 25 17:13:43 EDT 2013


Hi Scott, Nick,

I seem to recall that the second edition of Jeffrey Friedl's book on 
regular expressions there was a description of how the deterministic and 
non-deterministic machinery worked.  It might have had some pseudo code 
there, but it's been a long time.

(Full disclosure:  I was a reviewer for the various editions, not a 
co-author so I don't have a $ interest in it.)

On Tue, 25 Jun 2013, Scott Granados wrote:

> Hi Nick, that's pretty much where I was heading I think.  I have the same issue with JunOS as well in that they use a slightly different symbology in their expressions as well.
>
> Hmmm time to brush up the perl skills I think.
>
> Thanks for your response, much appreciated.
>
> On Jun 25, 2013, at 4:35 PM, Nick Hilliard <nick at foobar.org> wrote:
>
>> On 25/06/2013 20:44, Scott Granados wrote:
>>> Wondering if anyone has any good suggestions for a tool for creating and
>>> managing complex regular expressions?  I'm especially looking for a good
>>> way to generate / expand the members of a complex expression or to do a
>>> diff and generate a expression from that diff.  Any pointers would be
>>> most appreciated.  THis is for manipulating complex community
>>> environments.
>>
>> This sort of thing is pretty hairy.  It's possible to do, but because cisco
>> implemented their own variant of regular expressions, you will need to find
>> a cisco-specific regexp optimiser.  If you can't find this, then you will
>> in theory need to write a cisco-regexp to nondeterministic finite state
>> automata converter.  Once you've converted to a FSA, you can play around
>> with standard tools and then convert back again.  No idea if there is any
>> code out there which will do this automatically, but there are plenty of
>> standard (i.e. perl) regexp optimisation libs available on the net.
>>
>> Nick
>>
>
>
> _______________________________________________
> cisco-nsp mailing list  cisco-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-nsp
> archive at http://puck.nether.net/pipermail/cisco-nsp/
>

wfms


More information about the cisco-nsp mailing list