3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php var_dump(preg_match_all('#/search/(?P<mac>(?:[[:xdigit:]]{2}([-:]))(?:[[:xdigit:]]{2}\2){4}[[:xdigit:]]{2})#', '/search/12-12-12-12-12-12', $matches)); var_dump($matches);
Output for 4.3.3 - 7.1.0
int(1) array(4) { [0]=> array(1) { [0]=> string(25) "/search/12-12-12-12-12-12" } ["mac"]=> array(1) { [0]=> string(17) "12-12-12-12-12-12" } [1]=> array(1) { [0]=> string(17) "12-12-12-12-12-12" } [2]=> array(1) { [0]=> string(1) "-" } }
Output for 4.3.0 - 4.3.2
int(1) array(3) { [0]=> array(1) { [0]=> string(25) "/search/12-12-12-12-12-12" } [1]=> array(1) { [0]=> string(17) "12-12-12-12-12-12" } [2]=> array(1) { [0]=> string(1) "-" } }