Skip to main content

Greetings,

 

How do use alternation when I use regex in Parser Configuration?

 

I want to find all standard and extendend ACLs:

regexe$acl]:^ip access-list extended|standard (\S+)

 

The below command works, but I am trying to get it to work with regex:

ip access-list $_dummy(extended|standard) $acl

 

Cheers


Dave

I have found a workaround to my problem:

Method 1:

regex[$acl_type, $acl]:^ip access-list (extended|standard) (\S+)$

Creates 2 variables, one for ACL Type (Extended or Standard) and the ACL Name

 

Method 2:

regexe$acl_type, $acl]:^ip access-list \w+ (\S+)$

\w+ matches any alphanumeric string. Since there is only two types (standard and extended), this works too.


Reply