URLPattern is a built-in matcher for URL paths and full URLs. new URLPattern({pathname: '/users/:id'}).exec(input) returns named groups without hand-rolled regex.
It supports wildcards, optional segments, and even matching by hostname or protocol. The pattern syntax matches the one used by Workers and other modern routers.
Browser support is in Chrome and Safari; Firefox is shipping it through 2025. Bun and Deno already ship it; useful for tiny routers in service workers and edge functions.