Nick Hilliard wrote (on Fri 21-Aug-2015 at 23:23 +0100):
....
> On 21/08/2015 19:49, 'Chris Hall' wrote:
...
> > I imagine that any old regex, say:
> >
> > "(^| )(100|200|300):.*? 1234:\d*?666( |$)"
> >
> > is expected to do exactly what it says (as currently
> > implemented by Quagga) ? But I note that it would do
> > nothing at all if used with "set comm-list xxx delete"
> > (as currently implemented by Quagga).
I'll expand on this. What Quagga does for "comm-list delete" is run the
regex across the string form of the sorted and de-dupped communities, to
see if there is a match; if there is, it then runs the regex across each
individual community value, to identify which one(s) to delete.
Clearly, that only works for regexes which match to single community
values.
> > Or does one expect that, say, "100:.* 200:.*" is actually a "wild-
> > card" version of "100:10 200:10" ?
> community tags are unordered lists. "100:10 200:10" is the same
> as "200:10 100:10". "100:.* 200:.*" would only match the former,
> surely?
That's not quite what I was trying to get at, sorry. Given that,
indeed, the order of community tags is immaterial, I was wondering
whether treating "100:.* 200:.*" as an actual regex is really what is
expected or wanted. It seems to me that interpreting these more like
"wild cards" in file names would be closer to what folk actually want
(and more than half expect). Further, the regex "200:.* 100:.*" will
never match anything -- though "200:10 100:10" will work. And ".*:10
.*:5" would work some of the time -- "(.*:10 .*:5|.*:5 .*:10)( |$)"
might be what was intended. (But, hey, nobody said these things have to
be easy !)
Further, I continue to suspect that the fact that "100:.*" matches
"3100:..." will (momentarily) surprise people who do not wrangle regexes
for a living. I also rather suspect that in practice the ambiguity does
not arise, so if it does bite it will be a puzzle for a while :-(
What ".*:3" will match is also oodles of fun -- but perhaps there's no
call for that form of match ?
I found the following in some Cisco documentation:
The following example uses a regular expression. The example creates
a filter that will deny all communities that contain a number:
Router(config)# ip community-list 100 deny [0-9]*
<sigh>
Chris
_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev