uriTemplateMatches function
Whether uri is an expansion of the RFC 6570 URI template template
(resource templates: uriTemplate). Every operator is understood: simple
{x} (unreserved characters only, so a / is not part of the value),
reserved {+x}, fragment {#x}, label {.x}, path {/x}, path
parameters {;x}, query {?x} and continuation {&x}; prefix (:n)
and explode (*) modifiers are accepted. An undefined variable may
expand to nothing.
Implementation
bool uriTemplateMatches(String template, String uri) =>
_templateRegex(template)?.hasMatch(uri) ?? false;