FiltersCompiler icon indicating copy to clipboard operation
FiltersCompiler copied to clipboard

Some valid rules `[$domain=...]` with regex are treated as invalid

Open AdamWr opened this issue 11 months ago • 0 comments

For example this one:

! Error: "The $domain modifier is not allowed in a domain-specific rule" in the rule: "[$domain=/^i[a-z]*\.strmrdr[a-z0-9]+\..*/]#%#//scriptlet('set-constant', 'adscfg.enabled', 'false')"
[$domain=/^i[a-z]*\.strmrdr[a-z0-9]+\..*/]#%#//scriptlet('set-constant', 'adscfg.enabled', 'false')

https://github.com/AdguardTeam/FiltersRegistry/blob/a51b0d55e87ea3db5e7cbdcabc3c622b7cd83089/filters/filter_13_Turkish/diff.txt

It looks like that it's necessary to escape [ and ] even if it's valid in regexp and should works without escaping.

AdamWr avatar Jan 16 '25 10:01 AdamWr