3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $name = "O'Connor, 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 HeNUP
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
O'Co