fork download
  1. <?php
  2. $subject = "The price is $54.00 including delivery\n" .
  3. "On sale for £12.99 until December\n" .
  4. "European pricing €54.76 excluding UK";
  5. $pattern = '/\p{Sc}\s*\d[.,\d]*(?<=\d)/u';
  6. preg_match_all($pattern, $subject, $matches);
  7. print_r($matches);
  8. ?>
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => $54.00
            [1] => £12.99
            [2] => €54.76
        )

)