fork download
  1. import re
  2. pattern = re.compile(r'\<content>(.+?)\<date>',re.DOTALL|re.MULTILINE)
  3. text = """<content>THIS is the place to stay at when visiting the historical area of Seattle.
  4.  
  5. Your right on the water front near the ferry's and great sea food hotel.
  6.  
  7. The breakfast was great.
  8. <date>"""
  9. results = [x.replace("\n", "") for x in pattern.findall(text)]
  10. print(results)
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
["THIS is the place to stay at when visiting the historical area of Seattle.Your right on the water front near the ferry's and great sea food hotel.The breakfast was great."]