pillarjs/path-to-regexp is a TypeScript project with 8.6k stars in the Backend space. Turn a path string such as `/user/:name` into a regular expression
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Parameters match arbitrary strings in a path by matching up to the end of the segment, or up to any proceeding tokens. They are defined by prefixing a colon to the parameter name (:foo). Parameter names can use any valid JavaScript identifier, or be double quoted to use other characters (:"param-name").
Wildcard parameters match one or more characters across multiple segments. They are defined the same way as regular parameters, but are prefixed with an asterisk (*foo).
The match function returns a function for matching strings against a path:
path String, TokenData object, or array of strings and TokenData objects.
options(optional) (Extends pathToRegexp options)
decode Function for decoding strings to params, or false to disable all processing. (default: decodeURIComponent)
const fn = match("/foo/:bar");
Please note:path-to-regexp is intended for ordered data (e.g. paths, hosts). It can not handle arbitrarily ordered data (e.g. query strings, URL fragments, JSON, etc).
PathToRegexp
The pathToRegexp function returns the regexp for matching strings against paths, and an array of keys for understanding the RegExp#exec matches.
path String, TokenData object, or array of strings and TokenData objects.
options(optional) (See parse for more options)
sensitive Regexp will be case sensitive. (default: false)
end Validate the match reaches the end of the string. (default: true)
delimiter The default delimiter for segments, e.g. [^/] for :named parameters. (default: '/')
trailing Allows optional trailing delimiter to match. (default: true)
An effort has been made to ensure ambiguous paths from previous releases throw an error. This means you might be seeing an error when things worked before.
Missing parameter name
Parameter names must be provided after : or *, for example /*path. They can be valid JavaScript identifiers (e.g. :myName) or JSON strings (:"my-name").
Unexpected ? or +
In past releases, ?, *, and + were used to denote optional or repeating parameters. As an alternative, try these:
For optional (?), use braces: /file{.:ext}.
For one or more (+), use a wildcard: /*path.
For zero or more (*), use both: /files{/*path}.
Unexpected (, ), [, ], etc.
Previous versions of Path-to-RegExp used these for RegExp features. This version no longer supports them so they've been reserved to avoid ambiguity. To match these characters literally, escape them with a backslash, e.g. "\\(".
Unterminated quote
Parameter names can be wrapped in double quote characters, and this error means you forgot to close the quote character. For example, :"foo.
Express <= 4.x
Path-To-RegExp breaks compatibility with Express <= 4.x in the following ways:
The wildcard * must have a name and matches the behavior of parameters :.
The optional character ? is no longer supported, use braces instead: /:file{.:ext}.
Regexp characters are not supported.
Some characters have been reserved to avoid confusion during upgrade (()[]?+!).
Parameter names now support valid JavaScript identifiers, or quoted like :"this".
How active is development on pillarjs/path-to-regexp?
The most recent commit recorded on pillarjs/path-to-regexp was 18 days ago, based on the GitHub push timestamp. The repository has 484 forks — one of the better signals of community interest.
How many stars does pillarjs/path-to-regexp have?
pillarjs/path-to-regexp has 8.6k GitHub stars — refresh the page for the live number, or check github.com/pillarjs/path-to-regexp. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is pillarjs/path-to-regexp open source?
Yes — pillarjs/path-to-regexp ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/pillarjs/path-to-regexp.
What else is in the Backend space?
pillarjs/path-to-regexp is tracked by TopGit under the Backend category, alongside 4 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is pillarjs/path-to-regexp?
pillarjs/path-to-regexp (pillarjs/path-to-regexp) is a TypeScript project on GitHub. From the project's own README: Turn a path string such as `/user/:name` into a regular expression
What language is pillarjs/path-to-regexp written in?
pillarjs/path-to-regexp is written primarily in TypeScript. GitHub's language field is based on the largest share of bytes in the default branch.
What license does pillarjs/path-to-regexp use?
pillarjs/path-to-regexp is released under the MIT license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about pillarjs/path-to-regexp?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/pillarjs/path-to-regexp is the definitive source.
Read full README in the tab above.
Want a second opinion on path-to-regexp?
Ask an AI that can read this page — one click and you get its take on path-to-regexp.