1 个仓库
Tools that compile human-readable path templates into functional regular expressions.
Distinguishing note: Existing candidates focus on regex-to-regex conversion or file-path-to-URL mapping, not path-template-to-regex compilation.
Explore 1 awesome GitHub repository matching web development · Route Pattern Compilers. Refine with filters or upvote what's useful.
path-to-regexp 是一个 HTTP 路由匹配器和正则表达式生成器,将参数化路径字符串转换为正则表达式,用于匹配 Web 地址。它作为一个 URL 路由解析器和模式编译器,能够将人类可读的路径模板转换为用于路由的功能表达式。 该项目提供了根据定义的路径模式从 URL 中提取命名参数和通配符的功能。它还处理动态路径生成的反向过程,通过将值注入定义的参数占位符,将键值对转换为格式化的路径字符串。 该库涵盖了更广泛的路由实用程序,包括基于令牌的路径解析以及定义自定义参数分隔符的能力。它还支持锚点控制的匹配,以确定正则表达式是否必须从输入字符串的开头或结尾开始匹配。
Transforms path strings containing parameters and wildcards into regular expressions for URL matching.