fork download
  1. import re
  2. p = re.compile(r'(\w+)\s=\s(.+?)(?=$|\n[A-Z])', re.DOTALL)
  3. raw = '''
  4. CONTENT = ALL
  5. TABLES = TEST.RAW_1
  6. , TEST.RAW_2
  7. , TEST.RAW_3
  8. , TEST.RAW_4
  9. PARALLEL = 4
  10. '''
  11. print(p.findall(raw))
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
[('CONTENT', 'ALL'), ('TABLES', 'TEST.RAW_1\n        , TEST.RAW_2\n        , TEST.RAW_3\n        , TEST.RAW_4'), ('PARALLEL', '4')]