替换两个数字之间的昏迷点

Replace the point on coma between two digits

你能告诉我如何正确地制作一个正则表达式来用句子中两个数字之间的一个点替换一个点吗? 例如:

Text text 119.20 text. Text text.
to
Text text 119,20 text. Text text.

我找到了这样的例子,但是这个表达式错误地处理了 4 位数字。

preg_replace('/([\d]).([\d])/',',',$example);

我已经修改了您的正则表达式以按照您的意愿执行:

$test_string='Text text 119.20 text. Text text.';

$regex_numbers=preg_replace('/(\d)\.(\d)/', ',', $test_string);

echo $regex_numbers;