fork download
  1. <?php
  2.  
  3. preg_match('/(.*?)(\d+)(?!.*\d)/', 'GB67 7HG', $matches);
  4. print_r($matches);
  5.  
  6. ?>
  7.  
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
Array
(
    [0] => GB67 7
    [1] => GB67 
    [2] => 7
)