
Por exemplo:
Important Line
Useless Line
Static Line
Important Line A
Useless Line A
Static Line
Important Line B
Useless Line B
Static Line
Important Line C
Useless Line C
Static Line
Como podemos transformá-los em:
Important Line
Important Line A
Important Line B
Important Line C
Responder1
Ok, depois de cavar um pouco mais. Encontrei uma solução que funciona.
(?m)(^[^\r\n]*\R+){1}Static Line[^\r\n]*\R+(^[^\r\n]*\R+){0}
expressão regular