3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $name = "Avalone, Doris B. - 09-01-2014 - a00005213.exe"; $searcharr = preg_match("/^\w+/", $name, $matches); if (strlen($matches[0]) >= 4) $searchstr = substr($matches[0], 0 ,4); else $searchstr = $matches[0]; print($searchstr);
based on s4HNO
Output for 4.3.0 - 7.1.0
Aval