cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
565
Views
0
Helpful
3
Replies

question about regular expressions

west33637
Level 1
Level 1

ip as-path access-list 1 permit _\(65301\)

 

Hello all. Will the above regexp capture all prefixes originating from confederation peer AS 65301?

 

If not, what is the correct syntax?

 

Thanks,

1 Accepted Solution

Accepted Solutions

Hello ,

 

yes i did test this , when I test using _\(65301\) or ^\(65301\) or \(65301\) it was only matching prefixes generated by directly connected confederation peer AS ( 65301) .

 

I understand this happens because escape character (\) is supposed to match special character . and for the matter of fact I also achieved desired results using regular expression 65301\)

 

HTH 

Sunil Bhadauria

 

View solution in original post

3 Replies 3

Sunil Bhadauria
Level 1
Level 1

Hello ,

 

To match prefixes only originating from concerned confederation you can use below regular prefix :

 

Ip as-path access-list 1 permit  65301\)$ 

 

This will get you desired results .

 

Regards

Sunil Bhadauria 

Hello Sunil. Thanks for the response. Did you verify this works? I will verify over the weekend in my lab.

Hello ,

 

yes i did test this , when I test using _\(65301\) or ^\(65301\) or \(65301\) it was only matching prefixes generated by directly connected confederation peer AS ( 65301) .

 

I understand this happens because escape character (\) is supposed to match special character . and for the matter of fact I also achieved desired results using regular expression 65301\)

 

HTH 

Sunil Bhadauria