Route Pattern Tester
Test URL paths against route patterns written in Laravel, Express or Next.js syntax, and see which route matches each path and the parameters it captures.
Free · No sign-up · Your inputs stay in your browser
Input
Test URL paths against route patterns
Output
6 of 7 matched
| Path | Route | Parameters |
|---|---|---|
| /users/42 | /users/{user} | user=42 |
| /users/42/posts | /users/{user}/posts/{post?} | user=42, post=(absent) |
| /users/42/posts/hello-world | /users/{user}/posts/{post?} | user=42, post=hello-world |
| /blog/redis-cache | /blog/:slug | slug=redis-cache |
| /docs/guides/install/linux | /docs/[...path] | path=guides/install/linux |
| /files/a/b.txt | /files/* | wildcard=a/b.txt |
| /nope | no match (404) | - |
The first route that matches wins, which is how Laravel and Express resolve them: register /users/create before /users/{user}, or the literal path is captured as a parameter. A parameter matches one segment; catch-all segments match the rest of the path. Laravel's ->where() constraints and Next's static-before-dynamic priority are not modelled.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
First match wins
Laravel and Express try routes in registration order and stop at the first that matches. Register /users/{user} before /users/create and the literal path is captured as a user id; the fix is ordering or a constraint such as whereNumber. Laravel's route parameters documentation covers constraints and optional parameters.
Next.js is different
The App Router does not use registration order: a static segment always beats a dynamic one, and a dynamic segment beats a catch-all, whatever the file layout. Optional catch-alls also match the parent path.