Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Trying to use RegEx to parse a log file that consists of 3-line headers identifying multi-line text data

$
0
0

The log file I am trying to parse has the following format:

===================DateTimeStamp - ShortSummaryOfEntry===================Line 1 of textLine 2 of text ...Line last of text===================DateTimeStamp - ShortSummaryOfEntry===================Line 1 of textLine 2 of text ...Line last of text===================DateTimeStamp - ShortSummaryOfEntry===================Line 1 of textLine 2 of text ...Line last of text....

I have attempted the following pattern with numerous variations, all without success:

(={19}\n(.*)\n={19}\n)(\n.*)+(?=={19})

The look-around at the end appears to be overridden by the preceding "+". Group 0 shows the entire file content; group 1 and 2 are correct; and group 3 (the multi-line text data) is empty.


Viewing all articles
Browse latest Browse all 23131

Trending Articles