fork download
  1. <?php
  2.  
  3. $string = "Deze klant heeft bestelling 100222333 geplaatst maar ook bestellen 200222374 en bestelling 100222384";
  4.  
  5. preg_match_all('/(?<!\w)100\w+|(?<!\w)200\w+/',$string, $matches);
  6.  
  7. print_r($matches);
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => 100222333
            [1] => 200222374
            [2] => 100222384
        )

)