我正在尝试在我的Express应用程序中匹配以下url,该应用程序由用户的mongoDB组成
_id
还有一个bcrypt哈希:
/activate-account/609985503281dd186c052d0c/$2b$05$NcAX/OEXVopLUYSrD81bh.C/SfB.s6KZv8otlj7eu2rkEbqjqcgAa
下面的正则表达式使用
*
作品:
app.get('/activate-account/:id/:hash(*))
但是这个正则表达式使用
\s\S
不起作用:
app.get('/activate-account/:id/:hash([\s\S]{60})
然而,当我试图使用
Express Route Tester
,
以上两种方法都有效
.
为什么
app.get('/activate-account/:id/:hash([\s\S]{60})
在我的Express应用程序中不匹配?