- Ctrl + H
-
Encontre o que:^Name:\h+test-\d+\.\d+.+\R.+(?:\R\R?|$)
- Encontre o que:
^Name:\h+p208-\d{1,2}.+\R.+(?:\R\R?|$)
- Substituir por:
LEAVE EMPTY
- check Embrulhe
- verificar expressão regular
- NÃO VERIFIQUE
. matches newline
- Substituir todos
Explicação:
^ : 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
Dado:
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
Resultado para o exemplo dado:
Name: cottoncandy.fun.com
Address: 192.168.14.46