Skip to content
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

Regexp rule with $domain modifier doesn't work in 4.4 extension when the length of a domain is specified #136

Open
alexx7311 opened this issue Aug 14, 2024 · 8 comments
Assignees
Labels
bug Something isn't working Priority: P4

Comments

@alexx7311
Copy link

Steps to reproduce:

  1. Disable all filters
  2. Go to User rules and add [$domain=/^webteizle\d{0,2}\.info/]##body
  3. Open the filtering log on a new page and go to https://webteizle.info/izle/altyazi/justice-league-crisis-on-infinite-earths-part-one-w1

The rule should work on webteizle.info.

@Alex-302
Copy link
Member

Alex-302 commented Aug 14, 2024

Also not working

[$domain=/exampl[exyz]+.com)/]##body
[$domain=/exampl[exyz]+\.com/]##body - works

[$domain=/example\.(com|org)/]##body

image
image

@scripthunter7
Copy link
Member

scripthunter7 commented Aug 14, 2024

@alexx7311

Its a known problem; in the case of some modifiers, we need special tokenization in the future, but in the meantime the comma should be escaped, e.g.

[$domain=/^webteizle\d{0\,2}\.info/]##body

@scripthunter7
Copy link
Member

scripthunter7 commented Aug 14, 2024

@Alex-302

[$domain=/exampl[exyz]+\.com)/]##body
!                           ↑ missing opening parenthesis
[$domain=/example\.(com|org)/]##body
!                      ↑ pipe should be escaped, otherwise $domain considers it as a separator

@Alex-302
Copy link
Member

Alex-302 commented Aug 14, 2024

@scripthunter7 Isn't it separators check fail?

In uBO this regexp is valid
/example\.(com|org)/##body

@scripthunter7
Copy link
Member

Isn't it separators check fail?

What do you mean?

In uBO this regexp is valid /example\.(com|org)/##body

We don't yet support this syntax

@Alex-302
Copy link
Member

Alex-302 commented Aug 14, 2024

@scripthunter7 | is a part of regexp. Regexp with escaped $, |, , is not working in any other app. But this is required for AdGuard.

We don't yet support this syntax

I just tell about regexp, which works in UBO without "redundant" escaping.

missing opening parenthesis

Ok, this works
[$domain=/exampl[exyz]+\.com/]##body

@scripthunter7
Copy link
Member

@Alex-302 Yes, we'll need a special tokenization that allows regexps to be used without such escape constraints. But for this, the operation of the network rule / modifier parser must be completely reworked, several edge cases must be handled, care must be taken to ensure that no new issues arise and the parsing speed must also be kept at an appropriate level, but regardless, this improvement is already planned, and there are already related issues in the tracker, I think we'll implement it soon

@Alex-302
Copy link
Member

Great)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority: P4
Projects
None yet
Development

No branches or pull requests

5 participants