3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $expr = <<<REGEX / \b # word boundary [a-z]{2,3} # 2 or 3 letters \s* # optional spaces [0-9]{2-3} # 2 or 3 digits \s* # optional spaces [a-z]? # optional single letter \b # word boundary /ix REGEX; $strs = array( 'Honda : CRF 2005 honda crf 50 dirt bike pit bike', 'Honda : XR 2001 honda xr 400 r', 'Honda : CRF 2005 honda crf50 dirt bike pit bike', 'Honda : XR 2001 honda xr400r', ); foreach ($strs as $str) { if (preg_match($expr, $str, $matches)) { var_dump($match[0]); } }
Output for 4.3.0 - 5.6.21, hhvm-3.12.0, 7.0.0 - 7.1.0
Output for hhvm-3.10.0

Process exited with code 153.