-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
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
同一组规则中若干条规则会互相影响,v2.4.6 #382
Comments
我又尝试修改匹配条件、修改规则顺序、修改规则添加先后,发现完全没有明确的规律;一组规则,经过若干次变动后回到原先状态,甚至都无法得到相同的结果。 怀疑 ruleset 的编译和加载环节出现问题。 |
|
问题我找到了。
会被解析为 与 bug 相关的代码是这几行: Line 15 in 29aa764
Line 325 in 29aa764
MULTI_TO_ONE_RE 头尾的 \s* 会匹配掉前后的空行(换行),在 multi 模式的正则替换时,会产生重复替换。那为什么两条多行规则间没有空行时不会重复替换呢?因为这时唯一的 \n 被解释为matching 的多行边界。
已提 PR #383。 |
重新安装 whistle ,并重启 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
形如上述的两条路径替换规则无法同时生效,具体地只有第一条会生效。
这里的匹配模式是“(前缀)路径匹配”,实际上换成“通配符匹配”也一样有问题。
顺便,匹配原则是不是搞得太复杂了?(或者概念和架构并不清晰)
The text was updated successfully, but these errors were encountered: