DX Infrastructure Manager

Expand all | Collapse all

REG-EX help

  • 1.  REG-EX help

    Posted 09-15-2014 06:28 PM

    Any help on the following regular expression would be much appreciated. It was working until about a month ago.


    Trying to match: (just listed one interface but you can see the additional matches that are required)


    Interface-Down IF- [Se0/1/3:23] [187]


    My regex:




    Thank you

  • 2.  Re: REG-EX help

    Posted 09-16-2014 02:03 AM
    I'd suggest


    to match the example. Others will be similar.

    regexpal.com has a really nice tool for testing expressions too.

  • 3.  Re: REG-EX help

    Posted 09-16-2014 06:25 AM



    Thank you I will try it out.

  • 4.  Re: REG-EX help

    Posted 09-16-2014 09:46 AM

    Also, from your original regex:




    #1: There is no need for the leading .* since you don't have a ^

    #2: the *.*.*.*. is not probably not what you want to do? Unless you mean 0 or more - ? Should probably be .*.*.*.* but that doesn't make any sense either, unless you do .*\..*\..*\..*

    #3: That random / in the middle is just gonna break stuff unless you escape it. The way it is now, it's gonna stop your expression there.

    #4: Repeat..


    May I also recommend a regex cheat sheet? Something like this.