The URLPattern API provides a web platform primitive for matching URLs based on a convenient pattern syntax.
Wildcards, named capture groups, regular groups, and group modifiers are all supported.
The syntax is based on the popular path-to-regexp library.
Description
Used to create URL pattern matchers.
The URLPattern API provides a web platform primitive for matching URLs based on a convenient pattern syntax. Wildcards, named capture groups, regular groups, and group modifiers are all supported.
The syntax is based on the popular path-to-regexp library.
Specification
https://urlpattern.spec.whatwg.org/
Additional Signals
Safari position: support Firefox position: support Supported in Chrome and Edge and Deno
Developer sentiment
Ryan Toronto tweet with 580 likes Michael Jackson (creator of React Router and Remix) tweet Sebastien Lorber tweet
An Express maintainer is interested in using it for the Express router
There is a polyfill that is being downloaded from NPM many millions of times per week.