fork(25) download
  1. import re
  2.  
  3. s = "one two 3.4 5,6 seven.eight nine,ten,1.2,a,5"
  4. print re.split('\s|(?<!\d)[,.]|[,.](?!\d)', s)
Success #stdin #stdout 0.08s 10848KB
stdin
Standard input is empty
stdout
['one', 'two', '3.4', '5,6', 'seven', 'eight', 'nine', 'ten', '1.2', 'a', '5']