fork download
  1. import re
  2.  
  3. p = r"رده سنی مجاز :\s*\n(.+(?:\n.+)*)"
  4. text = "رده سنی مجاز : \n 10.2-15.3\n 8.71-9.13\n 25.08 - 31.2\n\nزده های سنی غیرمجاز:\n 16.5-18.4\n 9.15 - 10.02\n 20.02-21.30"
  5. m = re.search(p, text)
  6. if m:
  7. print([x.strip() for x in m.group(1).splitlines()])
Success #stdin #stdout 0.03s 9492KB
stdin
Standard input is empty
stdout
['10.2-15.3', '8.71-9.13', '25.08 - 31.2']