fork download
  1. import re
  2. input_str = "6.5 from1.2 .34 12.34 13.44.55 12.34.55.66 11.43 12.3 12. 12.78~ fdasfdashf 66.8987"
  3. print(re.findall(r"(?<!\S)\d+\.\d+(?!\S)", input_str))
  4. # 6.5, 12.34, 11.43, 12.3, 66.8987
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
['6.5', '12.34', '11.43', '12.3', '66.8987']