Router Pattern Converter
Convert Express, Next.js, Django, Rails, and Angular route patterns to a JavaScript regex and test paths against it.
Params: :name (Express/Next/Rails/Angular) or <name> (Django); a trailing ? makes a param optional.
Express (Node): :name captures a path segment; a trailing ? (name?) makes it optional.
Regex
^\/users(?:\/([^/]+))?$
Parameters (1)
| Group | Name | Optional |
|---|---|---|
| 1 | id | optional |
Matches