3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $code = '**3'; $test_code = str_replace('*', '[0-9]{1}', $code); echo 'test_code = '.$test_code."\n"; $course_filters = array('223','123'); if (!empty($course_filters)) { foreach ($course_filters as $key => $code) { preg_match('/'.$test_code.'/', $code, $matches); if ($matches) { echo "found = ".$code; } } }
Output for 4.3.0 - 7.1.0
test_code = [0-9]{1}[0-9]{1}3 found = 223found = 123