Hi,
wants to avoid interfaces Vlan20 to Vlan30 or upto any certain range.
I tried with 2 or 3 regular expression but its not working, please guide
Regards,
Tayyab
Not sure what you are trying to match, but this should find all VLANs except for 20-30 on a Cisco switch.
^interface Vlan(?!(2\d{1}|30)).*$
Thankyou for your reply!!!
I want to exclude certain range of Vlan.
e.g. Vlan10, Vlan15, Vlan20,Vlan21 Vlan22 etc
Ok, the above will exclude any VLAN interface from 20 to 30, but if you wanted to do other VLAN's aside from that you would need to modify it like the below for your example
^interface Vlan(?!(10|15|2[0-2]{1})).*$
To modify it for your needs exactly just change this part (10|15|2[0-2]{1}) to have only the VLAN's you want to exclude. You can list them individually in there if you want to as well so you could use (10|15|20|21|22) and just keep adding the numbers in there that correspond to the VLAN's you want to exclude and that should get you what you are wanting.
Using a tool like http://www.regexr.com/ to check syntax of your regular expressions when building them can be tremendously helpful.