In reference to a previous question Python data extract from text file - script stops before expected data match
How can I capture a match and the previous two lines? I tried this but get:
unterminated subpattern at position 0 (line 1, column 1)
output = re.findall('(.*\r\n{2}random data.',f.read(), re.DOTALL)