3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php preg_match('@^/([^/]+)/([^/]+)/([^/?]+)@', '/git/mat-omg/master?hash=fion', $match); preg_match('@^/([^/]+)/([^?]+)@', '/svn/modules/core/branches/5.6.2/', $match); //preg_match('@^/([^/]+)/([^?]+)@', '/git/mat-omg/master?hash=fion', $match); //$match = explode('/', $match[2]); var_dump($match);
based on d5ZW7
Output for 5.6.0 - 5.6.30, hhvm-3.12.14 - 3.17.3, 7.0.0 - 7.3.0beta1
array(3) { [0]=> string(33) "/svn/modules/core/branches/5.6.2/" [1]=> string(3) "svn" [2]=> string(28) "modules/core/branches/5.6.2/" }