diff --git a/src/router.ts b/src/router.ts index 425a682..a15fa9d 100644 --- a/src/router.ts +++ b/src/router.ts @@ -154,7 +154,7 @@ export class KoaRouter { //严格模式 if (option?.strict) regexpStr += "$"; - else regexpStr += "\b"; + else regexpStr += "\\b"; //生成正则表达式 const regexp = new RegExp(regexpStr);