fork download
  1. import re
  2. text = "income,and 4.6 test"
  3. text_wo_dots = re.sub(r'(?<!\d)[^\w\s]+(?!\d)',' ',text)
  4. print(text_wo_dots)
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
income and 4.6 test