[j-nsp] Community RegEx

Eric Van Tol eric at atlantech.net
Fri Sep 4 13:35:53 EDT 2009


> -----Original Message-----
> From: Richard A Steenbergen [mailto:ras at e-gerbil.net]
> Sent: Friday, September 04, 2009 11:26 AM
> To: Eric Van Tol
> Cc: juniper-nsp at puck.nether.net
> Subject: Re: [j-nsp] Community RegEx
> 
> On Fri, Sep 04, 2009 at 07:52:35AM -0400, Eric Van Tol wrote:
> >
> > I would think that the first one is the way to go, but it appears that
> > both work.  Is one a "more righter" way of defining these communities?
> 
> Thats like asking which of the following two math expressions is "more
> right":
> 
> A+B+C or (A+B+C)
> 
> Both say the same thing, the extra ()s on the second are unnecesary
> because you aren't doing anything else with the expression in which the
> parenthesis change the order of the operations. Now, if you were to
> later come along and add "* 2" to the expression it would suddenly make
> a difference to the result. But I doubt you would argue that you should
> always put all of your existing expressions inside unnecessary parens
> all the time, just incase someone were to come along and reuse your
> A+B+C snippit in another expression without fully understanding how math
> works. :)
> 
> --
> Richard A Steenbergen <ras at e-gerbil.net>       http://www.e-gerbil.net/ras
> GPG Key ID: 0xF8B12CBC (7535 7F59 8204 ED1F CC1C 53AF 4C41 5ECA F8B1 2CBC)

A private response (thanks, Chris!) indicates to me that the following two are actually correct:

^1234:((100)|(250)|(375))$
^1234:(100|250|375)$

My other example "works", but also matches on other patterns such as 999:250, 38549:250, and 7:100:

^1234:(100)|(250)|(375)$

-evt


More information about the juniper-nsp mailing list