cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1132
Views
0
Helpful
1
Replies

Regular Expressions after pipe

My google foo is off and I can't seem to find what I'm looking for. Hoping some of you fine folks can help me out!

I need to be able to do something like this:

sh run | in x.x.x.x - where x.x.x.x may equal 192.168.1.10, but not include 192.168.1.10x 

I tried: sh run | in 192\.168\.1\.10\ but it errors out.

I tried: sh run | in 192\.168\.1\.10 and it still brings up .10x results.

Mind you, my regex is far from proficient. I kind of just blunder through most of it until it works. But I'm at a loss here.

1 Accepted Solution

Accepted Solutions

Seb Rupik
VIP Alumni
VIP Alumni

Hi Richard,

Try the following:

sh run| inc 192.168.1.[0-9]2[^0-9]

...should do the trick.

http://www.cisco.com/c/en/us/td/docs/ios/12_2/termserv/configuration/guide/ftersv_c/tcfaapre.html

cheers,

Seb.

View solution in original post

1 Reply 1

Seb Rupik
VIP Alumni
VIP Alumni

Hi Richard,

Try the following:

sh run| inc 192.168.1.[0-9]2[^0-9]

...should do the trick.

http://www.cisco.com/c/en/us/td/docs/ios/12_2/termserv/configuration/guide/ftersv_c/tcfaapre.html

cheers,

Seb.