Minimal RFC 6570 URI template matching used to route resources/read requests to
a declared resource_template.
Supports level-1 {var} expressions. A bare {var} matches a single path segment
(no /); {+var} and {var*} match across segments. This is sufficient for the
common resource-template patterns; full RFC 6570 expansion is intentionally not
implemented.
Summary
Functions
Compiles a URI template into a {regex, var_names} pair for repeated matching.
Matches uri against template, returning extracted variables on success.
Functions
Compiles a URI template into a {regex, var_names} pair for repeated matching.
@spec match(String.t() | {Regex.t(), [String.t()]}, String.t()) :: {:ok, %{required(String.t()) => String.t()}} | :error
Matches uri against template, returning extracted variables on success.
Accepts either a raw template string or a precompiled {regex, vars} tuple.