. " ( ). , \..
*invalid by itself. It should look like x*, which means that the pattern "x" is repeated zero or more times. In your case, you need to match the number where it is used \d.
In addition, you will not want to replace Foo... 123.456with Foo 123. The number should appear ≥1 times. A +should be used instead *.
So your replacement should be
$y = preg_replace('/\\.\\d+/', "", $x);
(And to ensure that the truncation number is of the form 123.456, and not .456, use lookbehind.
$y = preg_replace('/(?<=\\d)\\.\\d+/', "", $x);
source
share