3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = '00:18:71:EC:38:58/072b8d45-895d-4d9d-9adb-e1502d6821d9.xml'; preg_match('/^(([0-9A-F]{2}[:-]){5}[0-9A-F]{2})+[\/]+([0-9a-z-]+[.]+[a-z]{3})$/', $str, $match); var_dump($match); $mac = $match['1']; $regkey = $match['3'];
based on aroFL
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(4) { [0]=> string(58) "00:18:71:EC:38:58/072b8d45-895d-4d9d-9adb-e1502d6821d9.xml" [1]=> string(17) "00:18:71:EC:38:58" [2]=> string(3) "38:" [3]=> string(40) "072b8d45-895d-4d9d-9adb-e1502d6821d9.xml" }