Solved

How do I use Regex Alternation ( Pipe Symbol "|") in Parser Configuration

  • 7 December 2021
  • 1 reply
  • 81 views

Userlevel 1

Greetings,

 

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

 

I want to find all standard and extendend ACLs:

regex[$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

icon

Best answer by dawal1337 16 December 2021, 10:14

View original

1 reply

Userlevel 1

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:

regex[$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


Community |  Ideas

Facebook |  Instagram |  Youtube |  Twitter |  LinkedIn
Privacy & Security Statement  |  Terms & Conditions |  Impressum  |  UK Modern Slavery Statement