Class UrlMatcher

Matches URLs against patterns.

Matches URLs against patterns and extracts named parameters from the path or the search
part of the URL.

A URL pattern consists of a path pattern, optionally followed by '?' and a list of search (query)
parameters. Multiple search parameter names are separated by '&'. Search parameters
do not influence whether or not a URL is matched, but their values are passed through into
the matched parameters returned by UrlMatcher.exec.

A parameter RegExp may be defined for a param after a colon
(/somePath/{param:[a-zA-Z0-9]+}) in a curly brace placeholder.
The regexp must match for the url to be matched.
Should the regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.

Custom parameter types may also be specified after a colon (/somePath/{param:int}) in curly brace parameters.
See UrlMatcherFactory.type for more information.

Catch-all parameters are defined using an asterisk placeholder (/somepath/*catchallparam).
A catch-all * parameter value will contain the remainder of the URL.

Parameter names may contain only word characters (latin letters, digits, and underscore) and
must be unique within the pattern (across both path and search parameters).
A path parameter matches any number of characters other than '/'. For catch-all
placeholders the path parameter matches any number of characters.

Examples:

'/hello/' - Matches only if the path is exactly '/hello/'. There is no special treatment for
trailing slashes, and patterns have to match the entire path, not just a prefix.

'/user/:id' - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or
'/user/bob/details'. The second path segment will be captured as the parameter 'id'.

'/user/{id}' - Same as the previous example, but using curly brace syntax.

'/user/{id:[^/]*}' - Same as the previous example.

'/user/{id:[0-9a-fA-F]{1,8}}' - Similar to the previous example, but only matches if the id
parameter consists of 1 to 8 hex digits.

'/files/{path:.*}' - Matches any URL starting with '/files/' and captures the rest of the
path into the parameter 'path'.

Tests if the given url matches this matcher's pattern, and returns an object containing the captured
parameter values. Returns null if the path does not match.

The returned object contains the values
of any search parameters that are mentioned in the pattern, but their value may be null if
they are not present in search. This means that search parameters are always treated
as optional.

Returns boolean

This comparison function converts a UrlMatcher into static and dynamic path segments.
Each static path segment is a static string between a path separator (slash character).
Each dynamic segment is a path parameter.