3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php preg_match("/^(\w+)+(-\w+)?$/", "about-us-office-",$matches); print_r($matches); echo "\n"; preg_match("%^(\w+)\-\w+?$%", "about-us",$matches); print_r($matches);
based on 0iEnP
Output for 4.3.0 - 7.2.0
Array ( ) Array ( [0] => about-us [1] => about )