Reading multiple lines into list : solution 2

/ Published in: Python
Save to your folder(s)

Copy this code and paste it in your HTML
  1. import re
  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


RSS Icon Subscribe to comments

You need to login to post a comment.