fork download
  1. # coding=utf8
  2. # the above tag defines encoding for this document and is for Python 2.x compatibility
  3.  
  4. import re
  5.  
  6. r = r".*(?= \S+ \S+)"
  7.  
  8. l = [
  9. "Level production data TD Index",
  10. "Total Agriculture\\Production data TS Index"
  11. ]
  12.  
  13. for s in l:
  14. m = re.match(r, s)
  15. if m:
  16. print m.group(0)
Success #stdin #stdout 0.01s 6860KB
stdin
Standard input is empty
stdout
Level production data
Total Agriculture\Production data