fork download
  1. import re
  2. string = '1. 0.1, 0.2, тест, тест. 2. тест, тест, 0.5=0.3+0.2.'
  3. new = re.sub(r'(?<=\d)\.(?=\d)', ',', string)
  4. print(new)
  5.  
Success #stdin #stdout 0.03s 9480KB
stdin
Standard input is empty
stdout
1. 0,1, 0,2, тест, тест. 2. тест, тест, 0,5=0,3+0,2.