fork download
  1. import re
  2. text = "test 10 20 middle 30 - 40 mm"
  3. print( re.split(r'(?<=\d)\s+(?:-\s+)?(?=\d)', text) )
Success #stdin #stdout 0.02s 9552KB
stdin
Standard input is empty
stdout
['test 10', '20 middle 30', '40 mm']