fork download
  1. import re
  2.  
  3. regex = r"\b\d+\.\d+(?:,\s*\d+\.\d+)+\b"
  4. s = "123.49, 19.30, 02"
  5.  
  6. match = re.search(regex, s)
  7.  
  8. if match:
  9. print(match.group())
Success #stdin #stdout 0.03s 9588KB
stdin
Standard input is empty
stdout
123.49, 19.30