Return to Snippet

Revision: 18601
at October 4, 2009 00:39 by freephys


Initial Code
import re

text = open("foo.txt").read()
RE = re.compile('firstword.*?wordx word word word (.*?) word.*?wordz word word word (.*?) word', re.DOTALL)
print RE.findall(text)

Initial URL
http://stackoverflow.com/questions/1062171/python-reading-multiple-lines-into-list

Initial Description


Initial Title
Reading multiple lines into list : solution 2

Initial Tags


Initial Language
Python