ASP.NET Core Route Tester
Test ASP.NET Core route templates against a URL path — see which one matches, the extracted route values, and why the others didn't.
What this tool does
Paste one or more ASP.NET Core route templates — one per line — and a test URL path, and see which templates match, what route values get extracted, and exactly why the non-matching ones failed: a literal segment mismatch, a segment count mismatch, or a failed constraint. It implements route template parsing and the common built-in constraints as a hand-written matcher, entirely in your Blazor Server session — nothing is sent to a separate API.
Worked example
Testing these templates:
api/orders/{id:int}
api/orders/{id:guid}
blog/{year:int}/{slug}
against the test path api/orders/42 matches the first template with id = 42, fails the second with "parameter 'id': '42' fails constraint 'guid'", and fails the third with a segment-count mismatch.
Supported constraints
These are ASP.NET Core's built-in inline route constraints, reimplemented here to match their real validation rules: int, bool, guid, datetime, decimal, double, float, long, minlength(n), maxlength(n), length(n) or length(min,max), min(n), max(n), range(min,max), alpha, regex(pattern), and required. Multiple constraints can be chained on one parameter ({id:int:min(1)}) — all of them must pass.
Optional parameters, defaults, and catch-all
{id?} marks a trailing parameter optional — if the URL is shorter than the template by exactly that segment, the template can still match with that route value simply absent. {id=1} gives a default value used the same way when the segment is missing from the URL. {**path} (or the legacy {*path}) is a catch-all that must be the last segment — it captures everything remaining in the URL, slashes included, as a single route value.
What this tool doesn't do
This is a rule-based reimplementation of the common matching rules, not ASP.NET Core's actual internal routing engine. It evaluates each template you paste independently and doesn't resolve ambiguity between multiple templates that could all match the same URL — real ASP.NET Core routing picks one route using precedence rules (more specific literal segments winning over parameters, for example) that this tool doesn't implement. A constraint name it doesn't recognize is listed explicitly as unevaluated next to that template's result rather than silently assumed to pass or fail.
How to use this tool
- Paste one or more route templates, one per line, into the templates editor.
- Enter a test URL path (no leading slash needed, but it's fine if you include one).
- Click Test (or Ctrl+Enter).
- Review each template's match result, extracted route values, or failure reason.
Route templates (one per line)
api/orders/{id:int}
api/orders/{id:guid}
blog/{year:int}/{slug}Enter one or more route templates and a test URL path, then click Test.