Thursday 5 July 2018

regular expressions



^ start of line
$ end of line


Find lines starting with Vlan and select to the end of the line
^Vlan.*$

Find lines starting with Vlan and select the next line also
^Vlan.*[\r\n].*[^\r\n].*


Finding switch ports that are admin down and
^GigabitEthernet.*down,.*[\r\n].*[^/r/n]output\s\d.*


Find an IP group
(\d{1,3}\.\d{1,3}.\d{1,3}\.\d{1,3})

First group is called $1, second is $2 etc

In sublime we can to find
(\d{1,3}\.\d{1,3}.\d{1,3}\.\d{1,3})
replace
insert something $1

that would find 
192.168.0.1
replace 
insert something 192.168.0.1

Find
(Printer)
Replace 
set address $1

No comments:

Post a Comment