3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string="1001-sdfjh"; $matches=array(); preg_match("/^(\d{4})-([A-Za-z0-9]{5})/", $string, $matches); print_r($matches); ?>
Output for 4.3.0 - 7.1.0
Array ( [0] => 1001-sdfjh [1] => 1001 [2] => sdfjh )