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

I want to rewrite a path starting with `/some/path` whether or not it has a trailing slash (or a sub route), and ignores the query, simply copying it to the...

question

I am trying to match greater than > and lesser than < symbols in the path of Express 4.17.1, but it is not working. I tried regex match using /[\>\

question

I'm trying to rewrite non-localized paths (e.g /page1) to localized ones (/de/page1) and therefore I'm seeking help to get the following to work: - "/de" or "/en" should NOT be...

question

Currently `PathFunction` is typed such that its parameter is optional, however this allows mistakes such as the following: ```ts import * as p from 'path-to-regexp'; const fn = p.compile('/users/:id'); fn({...

I ran into this problem while using `path-to-regex` in my own app, and was able to reproduce it in the unit tests in this repo. For example, when using the...

There are some issues: #95, #106 but I'm not sure if that is the same case. I want to achieve something like optional group matching based on presence of a...

help wanted
ideas

I initially had a much more complex idea, using character classes and what not (to allow `()` in some cases), but then realized that it can be easily done by...

I pass an empty array in match function, then I get trouble: ``` const { match } = require('path-to-regexp') urlMatchFn = match([]) console.log(urlMatchFn('/foo')) // { path: '', index: 0, params:...

bug

Given two paths, e.g. `/foo/bar` and `/foo/(.*)`, I would like to check if the former is a subset of the latter. In other words, determine whether all requests matched by...

I've noticed, due to how the lexer is written, it's not particularly difficult to make invalid patterns that won't be detected as being erroneous, specifically when ')' appears at weird...

enhancement