路径否定

作者: blakeembrey创建于 2025年6月11日更新于 2025年7月14日

经常有人希望能够排除路径不匹配: https://GitHub.com/pillarjs/path-to-regexp/issues/378, https://GitHub.com/pillarjs/path-to-regexp/issues/268, https://GitHub.com/pillarjs/path-to-regexp/issues/252, https://GitHub.com/pillarjs/path-to-regexp/issues/99 等。由于 v8 中直接的正则表达式输入已被删除,因此无法再使用 `((?!login).*)` 的工作方法。为了创建此功能的更简单版本,我建议在 v8 中添加新的语法来支持它。

内容来源: pillarjs/path-to-regexp