09-19-2020 06:28 AM
Hi
Can anyone help me with an expanded community list regex question please?
I couldn't get the below to work. It just picked up nothing, although, on online regex checkers it works:
^(649[0-9][0-9]):(.{1,5})$
I did manage to get the following working though:
649[0-9][0-9]:*
If anyone can let me know where I'm going wrong that would be appreciated.
Many thanks
09-19-2020 09:50 AM - edited 09-19-2020 10:04 AM
What do you need to match ? In expanded community lists, regular expressions are used to specify patterns to match COMMUNITIES attributes; the syntax you use looks like you are trying to filter on AS.
09-20-2020 12:35 PM
Hi
Thanks for replying.
I am trying to match a community list with a name of say 649XX:YYY_CL and it should match any community that starts 649 plus 2 more digits, has a : in the middle and then between 1 and 5 additional characters..
It's definitely trying to match the community value but the AS number of where the traffic came from helps create the actual community value that is assigned to a route.
Thanks
09-20-2020 01:41 PM
Hi there,
The second part of your regex (after the colon) does not match enough charecters for your example. It should be:
^(649[0-9][0-9]):(.{1,6})$
...but this can be improved a little:
^649\d{2}:.{1,6}$
cheers,
Seb.
09-26-2020 09:01 AM
Hey Seb
Thanks very much. I’ll give it a go.
out of curiosity, do the Cisco routers support the full range of regex characters and behaviours?
Cheers.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: