I am wondering how to implement Aaron Digulla's answer in this question: Fastest Text search method in a large text file
with open ('test.txt', 'rt') as myfile:
contents = myfile.read()
match = re.search("abc", contents)
What's next, so that I can find the previous EOL and next EOL, and so that I can extract the line?