fork download
  1. <?php
  2.  
  3. $string = 'N-05-0040(119) f 2005 svart hp Ml:153 - 160 - 20 - 75 Tot 31- 3- 3- 6- 13 (4)29,7M - (4)28,2aK Kr 204.500, 2pr 2010, Trener: Ole Olesen';
  4.  
  5. $regex = '~
  6. Kr\h* # Kr as string, followed by spaces or tabs
  7. ([.\d]+) # capture numbers like 123, 12.5 into the first group
  8. ~x';
  9.  
  10. preg_match_all($regex, $string, $matches);
  11. print_r($matches);
  12. ?>
Success #stdin #stdout 0.02s 52472KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => Kr 204.500
        )

    [1] => Array
        (
            [0] => 204.500
        )

)