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\$)";
  }