
Eu tenho uma lista de palavras e caracteres indesejados
hag-lawig
ha
waray
katapusan
/
¤
8¨2Þ‹%·/ój
An
ngatanan
nga
makakita
ha
akon
Quero remover todas as linhas que contenham caracteres diferentes de uma determinada sequência de caracteres; no meu caso, "az" e "-". Ou seja, neste caso, devem ser removidas as linhas que contenham "ó" "A" "%" etc.:
hag-lawig
ha
waray
katapusan
ngatanan
nga
makakita
ha
akon
Obrigado pela ajuda!
Responder1
- Ctrl+H
- Encontre o que:
^.*[^a-z-].*$\R?
- Substituir com:
LEAVE EMPTY
- confira Envolver
- verifique expressão regular
- DESMARCAR
. matches newline
- Replace all
Explicação:
^ # beginning of line
.* # 0 or more any character but newline
[^a-z-] # any character that is not lowercase or dash
.*
$ # end of line
\R? # any kind of linebreak, optional
Resultado para determinado exemplo:
hag-lawig
ha
waray
katapusan
ngatanan
nga
makakita
ha
akon