cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

Cisco Community Designated VIP Class of 2020

766
Views
0
Helpful
1
Replies
Highlighted

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.

Everyone's tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
VIP Advisor

Hi Richard,

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
VIP Advisor

Hi Richard,

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

CreatePlease to create content
Content for Community-Ad
FusionCharts will render here