Posted By

freephys on 10/04/09


Tagged


Versions (?)

Reading multiple lines into list : solution 2


 / Published in: Python
 

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

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

Report this snippet  

You need to login to post a comment.