fork download
  1. import re
  2. str1 = "test1.25nb 5test .5NB 00.5my_test 5unit 5.6"
  3. print( " ".join(re.split(r'\s*(\d*\.?\d+)\s*', str1)) )
  4.  
Success #stdin #stdout 0.02s 9460KB
stdin
Standard input is empty
stdout
test 1.25 nb 5 test .5 NB 00.5 my_test 5 unit 5.6