
Então eu tenho uma linha assim:
text1:text2:text3
Eu quero fazer assim:
text1:text3
Como fazer isso usando regex?
Responder1
Responder2
- Ctrl+H
- Encontre o que:
:[^:\r\n]+(?=:)
- Substituir com:
LEAVE EMPTY
- Replace all
Explicação:
: : a semicolon
[^:\r\n]+ : negative character class, any character that is not semicolon or linebreak
(?=:) : lookahead, make sure we have a semicolon after
- Verifique a expressão regular