private static function compileRegex(&$route, $pos){
    $re_catch_vars = '/\:([a-zA-Z0-9_]+)/';
    $re_replace_with = "(?P<R{$pos}V$1>[^/\?]+)";
    $replacement = preg_replace($re_catch_vars, $re_replace_with, $route);
    return "(?P<R$pos>^$replacement\$)";
  }
private static function compileRegex(&$route, $pos){
    $re_catch_vars = '/\:([a-zA-Z0-9_]+)/';
    $re_replace_with = "(?P<R{$pos}V$1>[^/\?]+)";
    $replacement = preg_replace($re_catch_vars, $re_replace_with, $route);
    return "(?P<R$pos>^$replacement\$)";
  }
private static function compileRegex ( & $ route , $ pos ) { $ re_catch_vars = '/\:([a-zA-Z0-9_]+)/' ; $ re_replace_with = "(?P<R{$pos}V$1>[^/\?]+)" ; $ replacement = preg_replace ( $ re_catch_vars , $ re_replace_with , $ route ) ; return "(?P<R$pos>^$replacement\$)" ; }
Build a route into a trapping regex
Build a route into a trapping regex