Files
music-platform/node_modules/path-to-regexp
hz4th_coder 595670b6ce feat: 音乐展示平台 v1.0.0
- 响应式设计,支持桌面端和手机端自适应
- 首页展示轮播图、推荐歌单、热门歌曲、新碟上架、热门歌手
- 歌曲/歌手/专辑/歌单详情页
- 底部播放器:播放/暂停、上下首、进度拖动、音量控制
- 歌词同步滚动显示
- 搜索功能
- 后台管理 /admin
- JSON文件存储
2026-07-07 23:57:31 +08:00
..
2026-07-07 23:57:31 +08:00
2026-07-07 23:57:31 +08:00
2026-07-07 23:57:31 +08:00
2026-07-07 23:57:31 +08:00

Path-to-RegExp

Turn an Express-style path string such as /user/:name into a regular expression.

Note: This is a legacy branch. You should upgrade to 1.x.

Usage

var pathToRegexp = require('path-to-regexp');

pathToRegexp(path, keys, options)

  • path A string in the express format, an array of such strings, or a regular expression
  • keys An array to be populated with the keys present in the url. Once the function completes, this will be an array of strings.
  • options
    • options.sensitive Defaults to false, set this to true to make routes case sensitive
    • options.strict Defaults to false, set this to true to make the trailing slash matter.
    • options.end Defaults to true, set this to false to only match the prefix of the URL.
var keys = [];
var exp = pathToRegexp('/foo/:bar', keys);
//keys = ['bar']
//exp = /^\/foo\/(?:([^\/]+?))\/?$/i

Live Demo

You can see a live demo of this library in use at express-route-tester.

License

MIT