cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
855
Views
10
Helpful
4
Replies

Community list regex question

anthonykahwati
Beginner
Beginner

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

4 Replies 4

Georg Pauwen
VIP Master VIP Master
VIP Master

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.

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

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.

 

 

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. 

Getting Started

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:

Recognize Your Peers