fork download
  1. import re
  2.  
  3. strings = [
  4. "3.14; 42.2",
  5. "3.14;42.2",
  6. "3.14, 42.2",
  7. "3.14,42.2",
  8. "3.14 42.2"
  9. ]
  10.  
  11. for s in strings:
  12. print(re.split(r"[;,] ?| ", s))
Success #stdin #stdout 0.03s 9340KB
stdin
Standard input is empty
stdout
['3.14', '42.2']
['3.14', '42.2']
['3.14', '42.2']
['3.14', '42.2']
['3.14', '42.2']