路径匹配正则表达式的起始字符串?

时间:2019-07-18 09:48:40

标签: javascript node.js regex

我正在尝试使用path-match来匹配以/_internal/static开头的路由。

因此,给出一些路线:

/ => should not match
/profile => should not match
/_internal/wBD17Ai4P3l04yNcyAkrn/pages/index.js => should match
/_internal/wBD17Ai4P3l04yNcyAkrn/pages/_app.js => should match
/static/app.css => should match
/_internal/static/wBD17Ai4P3l04yNcyAkrn/pages/page.js => should match

执行此操作的正确方法是什么?

1 个答案:

答案 0 :(得分:0)

尝试startsWith

((unsigned char*)NtCurrentTeb()->ProcessEnvironmentBlock)[3] |= 0x80;