Cisco IOS CLI RegEx

thomas_thomas_ CompTIA N+/S+/L+ CCNA R&S CCNP R&S/Enterprise/CollabMember Posts: 959 ■■■■■■■□□□
So, apparently this is a thing? I was reading online yesterday and came across some documentation on Cisco's website talking about regular expressions you can use to filter through the command line's output. This was quite a bit more in depth than just adding

| include

or

| begin

followed by a word. You can follow those with regular expressions instead of just using words or letters.

Perhaps the thing I liked most about what I read was when you're at the "----more----" section you can use the / + - symbols to filter what would normally appear had you just pressed the spacebar. The forward slash followed by a search term will search through it for that phrase. The "plus" sign with a search phrase to only include lines with that search term and the "minus" sign followed by a phrase to only include lines that don't have that term.

I knew you could use regular expressions with Linux, but it surprised me to learn that you can use them in the IOS CLI. Any one know if this is present in only certain versions of IOS or if it's available in all of them?

Comments

  • networker050184networker050184 Mod Posts: 11,962 Mod
    I don't think I could service without it! It's available in all versions as far as I know. Some behaviors are different moving between IOS and NX/XR though.
    An expert is a man who has made all the mistakes which can be made.
  • thomas_thomas_ CompTIA N+/S+/L+ CCNA R&S CCNP R&S/Enterprise/Collab Member Posts: 959 ■■■■■■■□□□
    It's such a useful thing I can't believe I hadn't heard of it before the other day. Even just a passing comment in the cert books would be good. Then again I guess if you don't know what regular expressions are then a comment about them probably wouldn't do much good.
  • MooseboostMooseboost Senior Member Member Posts: 775 ■■■■□□□□□□
    I don't think I could survive without them. We don't use a whole lot of Cisco, but we do have some Junipers with pretty massive configs (we provide VPN concentrators for some major content providers) and there is no way I could navigate without them.
    2020 Certification Goals: OSCE GXPN
    Blog: https://hackfox.net
Sign In or Register to comment.