05-29-2008 09:50 PM - edited 03-03-2019 10:10 PM
In BGP, to see AS path prepended routes I use below Regex.
sh ip bgp regexp _([0-9]+)(_\1)+_
Can anyone tell me how to write regular expressions to filter routes matching below conditions.
1. All BGP routes with no AS path prepends
2. All BGP routes with AS path prepended only 2 times
Are these possible with regular expressions ?
Thanks
05-29-2008 11:23 PM
I don't know answer about the first question. But for 2nd, use the following reg exp _([0-9]+)(_\1)?_ which lists the routes either without prepend or with AS-path listed 2 times.
Regards...
-Ashok.
06-01-2008 03:33 PM
Thanks Ashok for the reply.
For the first, I used other command to filter routes.
sh ip bgp | exclude _([0-9]+)(_\1)+_
But when I tried your reg exp, the '?' character is interpretted by CLI as a special character and CLI moves to a new line. How can I tackle this ?
06-01-2008 09:59 PM
Hmm, it's very simple.
Just press CTRL+V before typing "?".
Regards...
-Ashok.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide