src/packages/EmbedIO/Routing/RouteMatcher.cs
/// <summary>
/// Matches the specified URL path against <see cref="Route"/>
/// and extracts values for the route's parameters.
/// </summary>
/// <param name="path">The URL path to match.</param>
/// <returns>If the match is successful, a <see cref="RouteMatch"/> object;
/// otherwise, <see langword="null"/>.</returns>
Matches the specified URL path against
and extracts values for the route's parameters.
Matches the specified URL path against and extracts values for the route ' s parameters .
public RouteMatch Match(string path)
        {
            if (path == null)
                return RouteMatch.None;
            if (IsBaseRoute)
            {
                if (Route.Length == 1)
                    return RouteMatch.UnsafeFromRoot(path);
                if (ParameterNames.Count == 0)
                    return RouteMatch.UnsafeFromBasePath(Route, path);
            }
            var match = _regex.Match(path);
            if (!match.Success)
                return RouteMatch.None;
            return new RouteMatch(
                path,
                ParameterNames,
                match.Groups.Cast<Group>().Skip(1).Select(g => WebUtility.UrlDecode(g.Value)).ToArray(),
                "/" + (IsBaseRoute ? path.Substring(match.Groups[0].Length) : string.Empty));
        }
public RouteMatch Match ( string path ) { if ( path == null ) return RouteMatch . None ; if ( IsBaseRoute ) { if ( Route . Length == 1 ) return RouteMatch . UnsafeFromRoot ( path ) ; if ( ParameterNames . Count == 0 ) return RouteMatch . UnsafeFromBasePath ( Route , path ) ; } var match = _regex . Match ( path ) ; if ( ! match . Success ) return RouteMatch . None ; return new RouteMatch ( path , ParameterNames , match . Groups . Cast < Group > ( ) . Skip ( 1 ) . Select ( g => WebUtility . UrlDecode ( g . Value ) ) . ToArray ( ) , " " + ( IsBaseRoute ? path . Substring ( match . Groups [ 0 ] . Length ) : string . Empty ) ) ; }
Matches the specified URL path against
and extracts values for the route's parameters.
Matches the specified URL path against and extracts values for the route ' s parameters .
// Optimize for parameterless base routes
If the match is successful, a  object;
otherwise, .
If the match is successful a object ; otherwise .
path
string
The URL path to match.
The URL path to match .