import re
string = '1. 0.1, 0.2, тест, тест. 2. тест, тест, 0.5=0.3+0.2.'
new = re.sub(r'(?<=\d)\.(?=\d)', ',', string)
print(new)
