Regular Expressions..
Hey guys,
I just started reading the Cisco LAN switching handbook in preparation for my CCNP:Switch exam. Early on I discover that you can use regular expressions in your piped show run output. I frequently use begin and include but I have no idea how to look for anything more complicated than a simple string.
Can anyone point me to a good tutorial on this? I suppose it's regular regular expressions just like from Linux, but what I have tried so far doesn't work.
Thanks in advance!
I just started reading the Cisco LAN switching handbook in preparation for my CCNP:Switch exam. Early on I discover that you can use regular expressions in your piped show run output. I frequently use begin and include but I have no idea how to look for anything more complicated than a simple string.
Can anyone point me to a good tutorial on this? I suppose it's regular regular expressions just like from Linux, but what I have tried so far doesn't work.
Thanks in advance!
-Daniel
Comments
-
gaby_978 Member Posts: 222I recently learned that you can also use ( | ex ) to exclude certain outputs."If you spend too much time thinking about a thing,
you'll never get it done" -
QHalo Member Posts: 1,488
-
tndfr Member Posts: 110Cisco IOS uses the same concept of regular expressions just like any other scripting language such as Perl, php, python etc....
lets say you want to list all references to an ip address (regardless) on a config file
show run | include ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)Working on CCNP 642-813 and finishing off MCSA. -
hasitha257 Member Posts: 25 ■□□□□□□□□□The best use of regular expressions is in BGP ( Filter list etc...)
-
dynamik Banned Posts: 12,312 ■■■■■■■■■□
-
Yahel Member Posts: 42 ■■□□□□□□□□
That looks like a cool book ThanksCCNA = Passed (01-02-2011)
NEXT : CCNP ROUTE