The WHATWG Blog

Please leave your sense of logic at the door, thanks!

The URL Pattern Standard

by Domenic Denicola in What's Next, WHATWG

Welcome to the newest standard maintained by the WHATWG: the URL Pattern Standard! The URL Pattern Standard gives a generic pattern syntax for matching URLs, and extracting the parts from them. It is inspired by the path-to-regexp library, although it extends beyond paths to encompass all the parts of a URL. You can read more about the API on MDN.

The URL Pattern Standard joins us as a graduation from the WICG, where it was authored by Ben Kelly. As part of the move to becoming a Living Standard, Jeremy Roman and Shunya Shishido are joining Ben as editors to help maintain and evolve the standard.

We see the URL Pattern Standard being adopted in many upcoming proposals, including speculation rules, compression dictionary transport, and service worker static routing. It has also seen adoption with implementations beyond web browsers, such as in Deno, Cloudflare Workers, Next.js Edge Runtime, and Netlify Functions. We are excited to provide a home for this primitive going forward.

One Response to “The URL Pattern Standard”

  1. This should be useful for webcrawlers as well. I see the implementations list for runtimes and I believe Node.js 21.1.0 also implements the standard. Are there any implementations available via libraries for various programming languages? Is that something the open source community might do later or something the doesn’t make sense?