因此,我有一个dns名称列表,我希望使用Notepad ++过滤掉所有通用名称。
所以举个例子
Name: test-14.45.name.other.com
Address: 192.168.14.45
Name: cottoncandy.fun.com
Address: 192.168.14.46
显然,最简单的部分是在通用名称(test-14.45
)上加上书签,然后将其删除,因为它们在名称上都有一些共同之处。
所以我想知道的是,如何在每个非通用dns名称下面添加地址字段的书签?
^Name:\h+test-\d+\.\d+.+\R.+(?:\R\R?|$)
^Name:\h+p208-\d{1,2}.+\R.+(?:\R\R?|$)
LEAVE EMPTY
. matches newline
解释:
^ : beginning of line
Name: : literally
\h+ : 1 or more horizontal spaces
p208- : literally
\d{1,2} : 1 or 2 digits
.+ : 1 or more any character but newline
\R : any kind of linebreak (i.e. \r or \n or \r\n)
.+ : 1 or more any character but newline
(?: : start non capture group
\R\R? : 1 or 2 linebreak
| : OR
$ : end of line
) : end group
鉴于:
Name: p208-14.45.name.other.com
Address: 192.168.14.45
Name: cottoncandy.fun.com
Address: 192.168.14.46
Name: p208-14.44.name.other.com
Address: 192.168.14.45
给定示例的结果:
Name: cottoncandy.fun.com
Address: 192.168.14.46
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句