fork download
  1. <?php
  2. $string = 'Lorem ipsum dolor. Consetetur elitr 2.000 BC sed diam nonumy 300.';
  3. $pattern = "~\d+\K\.(?=\d+)~";
  4. $replacement = "";
  5. echo preg_replace($pattern, $replacement, $string);
  6. ?>
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Lorem ipsum dolor. Consetetur elitr 2000 BC sed diam nonumy 300.