1

我正在尝试在传入请求的中间匹配正则表达式模式。

我已经验证了我的正则表达式模式适用于 regex101.com。

该文档指出,addHttpRequestHandler正则表达式将匹配给定正确模式的任何地方。

addHttpRequestHandler('/clinServicesScheduled',
'Scripts/clinServicesScheduled.js', 'clinServicesScheduled');

以上仅在请求开始时匹配。

在请求中间匹配的正确模式是什么?

http://127.0.0.1/data/dashboard/community/communityCode/clinServicesScheduled/month/ ...

http://livedoc.wakanda.org/Global-Application/Application/addHttpRequestHandler.301-636268.en.html

/myPattern: 拦截任何请求,/myPattern无论其在字符串中的位置如何。此模式将接受诸如/files/myPattern/myPattern.html和等请求/myPattern/bar.js

4

1 回答 1

2

尝试以下正则表达式。看起来 wakanda 总是从一开始就匹配urlPath,即使它在文档中的记录不同:http: //doc.wakanda.org/home2.en.html#/Global-Application/Application/addHttpRequestHandler.301-636268 。 zh.html

addHttpRequestHandler('.*/clinServicesScheduled', 'Scripts/clinServicesScheduled.js', 'clinServicesScheduled');

我以前用它来捕获请求字符串中间的模式

于 2016-02-24T09:07:09.147 回答