Regular expression on specific domain

Various discussions related to filter list maintenance

Moderator: njones

Post Reply
User avatar
Gingko
Posts: 3
Joined: Sun Jun 05, 2016 9:19 am
Location: IDF, France

Regular expression on specific domain

Post by Gingko »

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
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Regular expression on specific domain

Post by mapx »

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
Gingko
Posts: 3
Joined: Sun Jun 05, 2016 9:19 am
Location: IDF, France

Re: Regular expression on specific domain

Post by Gingko »

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
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Regular expression on specific domain

Post by mapx »

for android just install uBo (ublock origin). ABP still did not implemented the custom filters in FF on android
Post Reply