Express Route Pattern Tester
Tests a URL against Express-style route patterns (/users/:id), showing which one matches first, the extracted params and route conflicts.
Supported: :param, :param?, :param(\d+), * at the end for the rest of the path. The query string is separated and never takes part in the match.
Result
Every pattern that matches
Conflicts
Generated regex
How the router picks a route
Express walks the stack in registration order and stops at the first pattern whose regex matches the pathname. A generic /users/:id declared before /users/me swallows the literal route, and no error is raised — the second handler simply never runs. That is why the order block below marks the shadowed patterns.
Params always capture a single segment, so :id never crosses a slash — /files/a/b needs a trailing wildcard. Captured values arrive percent-encoded and Express decodes them, which is why café shows up as caf%C3%A9 in the raw column. Everything here runs in your browser; no pattern or URL is sent anywhere.
Why your Express route is not matching
Paste the patterns in the same order they appear in your routes file and the test answers the question that matters: which handler Express would call for this URL. An app with /users/:id on line 12 and /users/me on line 30 never reaches the second route, because the param swallows the word me and req.params.id ends up holding the string me. The order block marks that shadow line by line.
Each pattern becomes an anchored regex, built segment by segment. A :id captures a single stretch between slashes, so /files/a/b only matches with a wildcard at the end; :cid? makes the whole segment optional rather than just the value; and :id(\d+) swaps the generic group for the regex you wrote. Paste a full URL and the query string stays out of the match and is shown apart, exactly as the router treats it.
The detail that trips up debugging is encoding. Values arrive percent-encoded and are decoded only after the match, so /busca/caf%C3%A9 fills req.params with the accented word, while a broken sequence such as %ZZ throws a URIError out of decodeURIComponent instead of returning a 404. Express ignores letter case by default and treats /a and /a/ as the same route, and the two switches above reproduce that behaviour.
Frequently asked questions
Does this work for Fastify, Koa or React Router?
Why does my literal route never run?
How many segments does the wildcard capture?
Related Tools
SemVer Range Tester
Tests which versions satisfy a semver range (^1.2.3, ~2.0, >=1 <2) and explains the range as a lower and an upper bound.
Regex Tester
Test regular expressions in real time. See highlighted matches and captured groups.
OAuth2 Authorization URL Builder
Monta URL de autorização OAuth 2.0 com response_type, client_id, redirect_uri, scope, state.