11-10-2020 11:24 PM
Hello,
for the comliance engine I have to find all interfaces not have a certain command line.
Here is a positive an a negativ example:
interface GigabitEthernet1/0/48
description Test1
switchport access vlan 830
switchport mode access
switchport voice vlan 310
no cdp enable
!
interface GigabitEthernet1/0/49
description Test2
switchport mode trunk
switchport nonegotiate
queue-set 2
mls qos trust dscp
channel-group 1 mode active
ip dhcp snooping trust
!
I am looking for an regex matching the hole interface 1/0/48 and NOT the interface 1/0/49.
The criterion should be, that all interfaces are found in which “mls qos trust dscp” is NOT present.
I tried “interface GigabitEthernet\d{1,2}\/\d{1,2}\/\d{1,2}[\s\n\w-].*?(?:(?<!mls qos trust dscp)[\s\n\w-])*?!” but this regex match all interfaces and not only the 1/0/48. But this is not working.
Any ideas?
Solved! Go to Solution.
11-24-2020 02:01 PM
Hello Mig,
your assumption was right, the compliance check does not support multiline regex, this is function as designed. This was the offical answer from GTAC.
11-11-2020 08:48 AM
Hi Stephan,
I think you’ll have to open a case at GTAC.
From my understanding the compliance engine will use python in the background and they seem to have the global flag active for the regex. This flag cannot be deactivated from within the regex.
Look at the following screenshots activting/deactivating the global flag:
Mig