We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
有n个待匹配的url例如: https://domain/path-aaa/ran02/path-bbb/file-d https://domain/path-aaa/ran67/path-ccc/file-e 其中ran后面为定长2位的随机数
https://domain/path-aaa/ran02/path-bbb/file-d
https://domain/path-aaa/ran67/path-ccc/file-e
本地目录X:\mock-domain\path-aaa\randxx分别有子目录path-bbb和path-ccc存放了file-d和file-e 写了一条正则rule匹配这类url让他们分别访问对应子目录里的文件: /https://domain/path-aaa/ran\d\d/path-bbb/file-d/ file://X:\mock-domain\path-aaa\randxx
/https://domain/path-aaa/ran\d\d/path-bbb/file-d/ file://X:\mock-domain\path-aaa\randxx
但实际测试对于任何匹配上的url都会只自动访问到X:\mock-domain\path-aaa\randxx,请问有简洁的正则办法让程序在randxx之后根据url自动拼接访问吗?
X:\mock-domain\path-aaa\randxx
另外不知道whistlek可不可以debug rule(规则)的解析与执行的过程,这样可以自行调试发现自己写的rule在哪里系统解析结果和预想的不一样,就能少提issue来麻烦作者了。
The text was updated successfully, but these errors were encountered:
有两种写法:
# 正则 /https://domain/path-aaa/ran(\d\d)/path-bbb/file-/ file://X:\mock-domain\path-aaa\rand$1 # 通配符 ^https://domain/path-aaa/ran*/path-bbb/file-* file://X:\mock-domain\path-aaa\rand$1
参考:https://wproxy.org/whistle/pattern.html
Sorry, something went wrong.
感谢作者的帮助,抱歉之前表述的有歧义,其实是想把 /https://domain/path-aaa/ran\d\d/path-bbb/file-1 /https://domain/path-aaa/ran\d\d/path-ccc/file-2 都匹配到 file://X:\固定dir\下 (X:\固定dir下有path-bbb\file-1和path-ccc\file-2等) 请问该如何撰写规则呢?
/https://domain/path-aaa/ran\d\d/path-bbb/file-1
/https://domain/path-aaa/ran\d\d/path-ccc/file-2
file://X:\固定dir\
提问之前有阅读过帮助文档pattern.html,请问这段描述
最多支持10个子匹配 $0...9,其中$0表示整个请求url,其它跟正则的子匹配一样 /[^?#]/([^\/]+).html/ protocol://...$1...
应该理解为$1为正则第一次匹配之后剩余的后续url部分?那么$2(对应的子匹配)是什么呢?
跟正则的子匹配一样,试试:
^https://domain/path-aaa/ran*/** file://X:\固定dir\$2
No branches or pull requests
有n个待匹配的url例如:
https://domain/path-aaa/ran02/path-bbb/file-d
https://domain/path-aaa/ran67/path-ccc/file-e
其中ran后面为定长2位的随机数
本地目录X:\mock-domain\path-aaa\randxx分别有子目录path-bbb和path-ccc存放了file-d和file-e
写了一条正则rule匹配这类url让他们分别访问对应子目录里的文件:
/https://domain/path-aaa/ran\d\d/path-bbb/file-d/ file://X:\mock-domain\path-aaa\randxx
但实际测试对于任何匹配上的url都会只自动访问到
X:\mock-domain\path-aaa\randxx
,请问有简洁的正则办法让程序在randxx之后根据url自动拼接访问吗?另外不知道whistlek可不可以debug rule(规则)的解析与执行的过程,这样可以自行调试发现自己写的rule在哪里系统解析结果和预想的不一样,就能少提issue来麻烦作者了。
The text was updated successfully, but these errors were encountered: