I have a large log file, and I want to extract a multi-line string between two strings: start and end.
start
end
The following is sample from the
This regex should match what you want:
(start((?!start).)*?end)
Use re.findall method and single-line modifier re.S to get all the occurences in a multi-line string:
re.findall
re.S
re.findall('(start((?!start).)*?end)', text, re.S)
See a test here.