3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php echo preg_match('/^([1-9]{1}[0-9]{3} ?[A-Z]{2})|([1-9]{1}[0-9]{3})$/', 123456789123456789, $matches); print_r($matches);
based on sJfq4
Output for 4.3.0 - 7.2.0
1Array ( [0] => 6789 [1] => [2] => 6789 )