pillarjs / path-to-regexp

Turn a path string such as `/user/:name` into a regular expression
MIT License
8.18k stars 382 forks source link

Add support for named matching groups. #301

Closed NorbertSzydlik closed 7 months ago

NorbertSzydlik commented 8 months ago

Express 4.x crashes when using named capturing group in regexp (see https://github.com/expressjs/express/issues/4277 ). As far as I know, this feature have been added in newer version of path-to-regexp. It seems that it will land in Express 5. This change aims to add the feature in current version of Express, which still uses path-to-regexp 0.1.x.

blakeembrey commented 7 months ago

Published as 0.1.8 although it could be a breaking change if people on the previous version were relying on it not matching in some way. The names do not change, only the index in the array, and only if they're using this feature of regex.