
예를 들어:
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
어떻게 하면 다음과 같이 바꿀 수 있나요?
Important Line
Important Line A
Important Line B
Important Line C
답변1
좋아, 조금 더 파고들면. 작동하는 솔루션을 찾았습니다.
(?m)(^[^\r\n]*\R+){1}Static Line[^\r\n]*\R+(^[^\r\n]*\R+){0}
정규식