cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
596
Views
0
Helpful
2
Replies

Regular Expressions in IOS

I am having a tough time with this one.

 

I need to show all the entries for a network, say 10.1.20.0/24.

 

If I do "sh run | in 10.1.20." I get what I need, plus stuff I don't need... Such as entries for networks like 10.1.201, 10.1.203, etc.

 

I've never been particularly good with regex, and I figured that the following would work:

 

sh run | in 10.1.20.$ 

 

But it did not.

 

I can't find a really good example on Google, so I figured I'd turn to the pros!

 

Thanks all!

1 Accepted Solution

Accepted Solutions

Chris McGarrah
Level 1
Level 1

Try this:

sh run | in 10\.1\.20\.

The dot matches any character in regex.  Putting the \ in front of it tells it you want to look for the dot.

View solution in original post

2 Replies 2

Chris McGarrah
Level 1
Level 1

Try this:

sh run | in 10\.1\.20\.

The dot matches any character in regex.  Putting the \ in front of it tells it you want to look for the dot.

Richard,

Chris has already shown you how to solve it; I just wanted to add this link:

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

 

HTH

Rolf