path-to-regexp icon indicating copy to clipboard operation
path-to-regexp copied to clipboard

Turn a path string such as `/user/:name` into a regular expression

Results 45 path-to-regexp issues
Sort by recently updated
recently updated
newest added

Hi, I have a question about decoding path params. I have a URL that contains encoded symbols in its static and parametric parts. To match the route, I decode the...

question

See issue #236 The returned regex object from `pathToRegex` used to include the modified keys array as a `keys` property in v1.7.0. The current API is not entirely ideal, since...

enhancement
needs tests
pr

The examples are unclear on why it works that way. Mutating params feels wrong, because in the code it is not very easy to understand how my empty keys array...

I have a route `/:parameter` and if someone pings that route I should serve him certain page (React App) So what I need is some kind of regexp that wont...

question

[Do not merge] Only opening a PR here for the CI tests to demostrate the bug. Global route match syntax cause a parsing error. For example, when using the route:...

pr

Add a extra package.json to the es2015 build that sets the nodejs esm flag if used inside nodejs

pr

say i have a request with a url ``` /foo/123 ``` how can I match anything except "foo" *while* having the first parameter be a named key? ```js // in...

question
docs

I realize that there is already a PR to add wildcard support. However, that PR is going to add some pretty big inconsistencies between named and anonymous wildcard groups, in...

enhancement

The following pattern used to match: ```js let re = pathToRegexp("/files/:path*\\.:ext*", paramNames); let match = "/files/my/photo.jpg/gif".match(re); ``` Version 3.0 works: https://codesandbox.io/s/old-thunder-x209j3nkko Version 5.0 works: https://codesandbox.io/s/angry-bhaskara-gkzf3 Version 6.1 does not work:...

bug