← All Tools

URLPattern Tester

The URLPattern web API matches URLs against a pattern string with named capture groups (:id), wildcards (*), modifiers (? / + / *), and inline regex ((\\d+)). Used by service workers, modern routers, and the View Transitions API. Paste a pattern, paste URLs, and see what matches and what each group captures.

Use :name for named groups, * for wildcards, optional (...) for inline regex, and modifiers ? / + / * after a group.
REST nested api/v1/users/42 files/* wildcard locale prefix optional date file ext
Advanced — match individual URL components

Instead of matching the whole URL, you can constrain individual parts: protocol, username, password, hostname, port, pathname, search, hash. Leaving these empty defers to the main Pattern field above.

Results
Generated JavaScript

    

Support: URLPattern is shipped in Chrome 95+, Edge 95+, and Safari 18+. Firefox is implementing it (off by default behind dom.urlpattern.enabled). All matching here runs in your own browser using the native API — falls back to a notice if unavailable.

Pattern syntax cheat sheet