{"repo":"pillarjs/path-to-regexp","free":true,"listed":false,"github":"https://github.com/pillarjs/path-to-regexp","clone":"git clone https://github.com/pillarjs/path-to-regexp.git","description":"Turn a path string such as `/user/:name` into a regular expression","language":"TypeScript","stars":8599,"topics":["path-to-regexp","expressjs","router","nodejs"],"license":"MIT","category":"dev-tools","readme_excerpt":"Path-to-RegExp Turn a path string such as /user/:name into a regular expression. [![NPM version][npm-image]][npm-url] [![NPM downloads][downloads-image]][downloads-url] [![Build status][build-image]][build-url] [![Build coverage][coverage-image]][coverage-url] [![License][license-image]][license-url] Installation Usage Parameters 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 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 ). Optional Braces can be used to define parts of the path that are optional. Match 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 ) 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","default_branch":null,"files":null,"tree":[],"storefront":"/r/pillarjs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pillarjs/path-to-regexp/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}