Advertisement
cwchen

Regex demo

Feb 28th, 2016
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. import re
  2.  
  3. with open('some_text.txt') as file:
  4.     data = file.read()
  5.  
  6.     matched = re.findall("----start----\n([^-]+)----end----", data)
  7.  
  8.     print matched[-1],
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement