fork download
  1. import re
  2. p = re.compile(r'Sample comments:\s*\[(.*?)\s*]')
  3. s = " Sample comments:\n\n [98 g/m2 Ctrl (No IP) 95 min 340oC ]\n\n [ ]"
  4. print(p.findall(s))
Success #stdin #stdout 0.01s 8968KB
stdin
Standard input is empty
stdout
['98 g/m2 Ctrl (No IP) 95 min 340oC']