So, you can attach a multiplier to a multicharacter sequence like so:
That mean one or more occurences of the sequence "ab"
But what if I want to match on a string that does NOT have this sequence? Like I want to match on a static route in a configuration that does not contain a tag...
"ip route .* [^(tag)]"
But that doesn't work... how do you specify that a string that does not contain a multi-character sequence?
Unfortunately the regular expression support in IOS is not like that of a scripting language like Perl/TCL. It is only a limited subset and there is no negation charater in that subset as far as i know.
According to documentation: You can reverse the matching of the range by including a caret (^) sign at the start of the range...The following example matches anything except a right square bracket (]) or the letter d: [^\]d]
So, maybe there is a problem with the meaning of the expression you have within brackets (i.e. the "^(tag)"). I am not sure exactly what this means in the context of a range enclosed within brackets. If you had [^tag] it would match anything except t or a or g. So, maybe could you try the following:
"ip route .*[^t][^a][^g].*"
After examining the syntax of the ip route command, I wonder whether you could have a "g" anywhere except within the word "tag". The only pitfalls I can think of now are: a name for the route that contains the letter "g" or a route via say some GigabitEthernet. So, maybe you could try the following:
"ip route ([^g])*" (i.e. no "g" anywhere)
"ip route (.*[^g]_)* (i.e. no "g" at the end of a word)
I must say I am not sure if any of the above will work, but it probably wouldn't hurt to try them out. Please let us know if any of those or something else worked for you.
Don't be in a hurry my friend. I was about to edit my previous post!
After some thinking, the first suggestion ("ip route .*[^t][^a][^g].*") will probably not work, because it could match a route that contains a tag via the surrounding wildcards. A better one might be: "ip route .*[^t][^a][^g]_.*" (i.e. 3 last letters of a word cannot be tag)
As I said previously, I'm not sure about what exactly is going to happen with those suggestions, but maybe we can all learn if author tries them out and provides some feedback.
Edit: Ok, even the suggestion of this post needs additional thinking. Maybe "ip route (.*[^t][^a][^g]_)*" is better. Anyway, I'll wait for feedback before correcting myself again
We are pleased to announce availability of Beta software for 16.6.3.
16.6.3 will be the second rebuild on the 16.6 release train targeted
towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are
looking for early feedback from customers befor...
Introduction Featured Speakers Luis Espejel is the Telecommunications
Manager of IENova, an Oil & Gas company. Currently he works with Cisco
IOS® and Cisco IOS XE platforms, and NX to some extent. He has also
worked as a Senior Engineer with the Routing P...
In this session you can learn more about Layer 3 multicast and the best
practices to identify possible threats and take security measures. It
provides an overview of basic multicast, the best security practices for
use of this technology, and recommendati...