3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $url = '/video/bb14ff1ecc65c3272a0ee199f8005b72.ogv'; $regex = '/^\/(download|thumbs|screens|video|strip)\/[a-zA-Z0-9\._\/]+/'; $arrMatch = array(); if (preg_match($regex, $url, $arrMatch)) { var_dump($arrMatch); }else{ echo 'NOK'; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(2) { [0]=> string(43) "/video/bb14ff1ecc65c3272a0ee199f8005b72.ogv" [1]=> string(5) "video" }