AdguardTeam / AdguardTeam/FiltersCompiler

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

Open
#241 0 comments 0 reactions 1 assignee Claimed by @maximtop View on GitHub
Priority: P4
Dominant language
JavaScript
Stars
64
Forks
11
PR merge metrics
No merged PRs in 30d

Description

For example this one:
```adblock
! 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.