1 Reply Latest reply on Aug 13, 2019 3:12 AM by jake-ruston

    Assistance with Regex Expressions - Compliance Reporting

    flamingprawn

      Hello everyone!

       

      Attempting to create a compliance report to verify configuration on our SVI's on the MDF switches... Struggling with the regex expression I need to create to accomplish the following:

       

      Config block needs to start at any "interface Vlan" that is 3 digits or more (ex: 100,110,200,300,400) and end at the ! so we're only looking at the configuration for each svi.

        • Re: Assistance with Regex Expressions - Compliance Reporting
          jake-ruston

          To match the whole block, for example:

          interface Vlan 100

               ip address 192.168.1.1 255.255.255.0

          !

          You can use the regex ^interface Vlan [0-9]{3,}(.|\n)*!$

            

          RegexExplanation
          ^

          Block has to start with the succeeding text/regex

          interface VlanMatches the text interface Vlan
          [0-9]{3,}Matches any digit, three or more times in a row
          (.|\n)*Matches any character or new line, zero or more times in a row
          !Matches the text !
          $Block has to end with the preceding text/regex
          1 of 1 people found this helpful