Regular expression on specific domain

Various discussions related to filter list maintenance

Moderator: njones

Regular expression on specific domain

Postby Gingko » Tue Apr 10, 2018 1:05 pm

Hello,

Could someone tell me how to create a regular expression filter that applies only to a given domain?

I mean, if I understand well, if I want to apply the rule ##.sponsor only to the domain example.com, it seems that I just have to write example.com##.sponsor.

But following this syntax, if I want to apply the rule /my.regexp/ to the same domain, I'd logically write example.com/my.regexp/, but in this case, the /my.regexp/ part will be seen as a query inside the domain, right?

Which separator should I use, then?
User avatar
Gingko
 
Posts: 3
Joined: Sun Jun 05, 2016 9:19 am
Location: IDF, France

Re: Regular expression on specific domain

Postby mapx » Tue Apr 10, 2018 1:08 pm

You should use
Code: Select all
/my.regexp/$domain=example.com


see an example from easylist:
Code: Select all
/http://[a-zA-Z0-9]+\.[a-z]+\/.*(?:[!"#$%&'()*+,:;<=>?@/\^_`{|}~-]).*[a-zA-Z0-9]+/$script,third-party,domain=keezmovies.com|redtube.com|tube8.com|tube8.es|tube8.fr|www.pornhub.com|youporn.com
User avatar
mapx
 
Posts: 21947
Joined: Thu Jan 06, 2011 3:01 pm

Re: Regular expression on specific domain

Postby Gingko » Tue Apr 10, 2018 1:17 pm

Ok, thank you very much.

It works (on Firefox).

By the way, do you know how to apply the same rule to the Firefox for Android addon?
User avatar
Gingko
 
Posts: 3
Joined: Sun Jun 05, 2016 9:19 am
Location: IDF, France

Re: Regular expression on specific domain

Postby mapx » Tue Apr 10, 2018 1:33 pm

for android just install uBo (ublock origin). ABP still did not implemented the custom filters in FF on android
User avatar
mapx
 
Posts: 21947
Joined: Thu Jan 06, 2011 3:01 pm


Return to Filter List Authors' Corner

Who is online

Users browsing this forum: No registered users and 3 guests