
Zum Beispiel:
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
Wie können wir sie umwandeln in:
Important Line
Important Line A
Important Line B
Important Line C
Antwort1
Okay, nachdem ich ein bisschen tiefer gegraben habe, habe ich eine Lösung gefunden, die funktioniert.
(?m)(^[^\r\n]*\R+){1}Static Line[^\r\n]*\R+(^[^\r\n]*\R+){0}
regulären Ausdruck