Regular Expressions 101

Community Patterns

cisco show run interface

0

Regular Expression
PCRE (PHP <7.3)

/
^interface (\S+)\n?(?:(?: description (.*)| ip address (\S+) (\S+)| .*)\n?)*
/
gm

Description

This regex fetches interface ID along with its ip address and description if configured otherwise blank

Submitted by anonymous - 4 years ago