3v4l.org

run code in 300+ PHP versions simultaneously
<?PHP $paths = [ '/cars$', '.*/cars$', '^cars/.*/', '/trucks$', '.*/trucks$' ]; $url = 'some-site.com/cars'; $res = array_filter($paths, function ($v) USE ($url) { return preg_match('~'.$v.'~', $url); }); echo count($res)." patterns matched:\n"; print_r($res); ?>

preferences:
52.64 ms | 406 KiB | 5 Q