정규식을 사용하여 텍스트 파일에서 섹션을 찾고 싶습니다. 나는 아래와 같은 파일이 있습니다 :정규식을 사용하여 텍스트 파일의 특정 섹션을 찾습니다.
This is general text section that I don't want.
HEADER:ABC1
This is section text under header
More text to follow
Additional text to follow
HEADER:XYZ2
This is section text under header
More text to follow
Additional text to follow
HEADER:KHJ3
This is section text under header
A match text will look like this A:86::ABC
지금, 나는 섹션 텍스트가 일치 A:86::ABC
이 포함 된 경우 HEADER
모든 섹션의 텍스트를 검색 할 수 있습니다. 결과 텍스트는
(HEADER:KHJ3
This is section text under header
A match text will look like this A:86::ABC).
입니다. 감사합니다. 나는 파이썬을 사용하고 있으며 일치하는 부분은 하나 이상의 파일에있을 수 있습니다. 또한 다중 행 파일입니다.
어떤 프로그래밍 언어를 사용하십니까? – user4035