Syntax: Contains + Ends With

General information, announcements and questions about the EasyList subscriptions.

Moderator: EasyList authors

Post Reply
adbob
New Member
New Member
Posts: 3
Joined: Wed May 17, 2017 7:51 pm
Reputation: 0

Syntax: Contains + Ends With

Post by adbob » Wed May 17, 2017 8:03 pm

Hi, I'm trying to create a list and want to get a syntax right but cannot for the life of me. Filter experts please help. For example,

I want to match with:

Code: Select all

https://www.google.com/bla/AD.PNG
http://ads.google.com/bla/AD.PNG
https://google.ca/bla/AD.PNG
https://adsbygoogle.com/bla/AD.PNG
And so forth. There is an endless list of TLDs that can exist so I'm not interested in typing out:

Code: Select all

||google.com
||google.ca
I also don't mind a slight amount of false positives but not excessive of course. Anyway the best I can come up with was:

Code: Select all

google*AD.PNG
It works but don't think it's the best rule possible. I couldn't figure out how to use the | to specify ends with whilst having other regexp within the rule. Obviously I want to be as specific as possible to make it efficient.

Thank you

intense
Contributor
Contributor
Posts: 6405
Joined: Wed Mar 27, 2013 9:56 am
Reputation: 65

Post by intense » Wed May 17, 2017 8:55 pm

add

Code: Select all

/ad.png|

adbob
New Member
New Member
Posts: 3
Joined: Wed May 17, 2017 7:51 pm
Reputation: 0

Post by adbob » Wed May 17, 2017 10:36 pm

Hi thank you for the response but it doesn't handle the "contains" part of my requirement. That rule will block anything ending with "ad.png" but does not require that the domain contains a "google" in it.

User avatar
smed79
Liste AR Author
Liste AR Author
Posts: 11527
Joined: Sun Jan 17, 2010 4:00 am
Reputation: 88
Location: EasyList Forum

Post by smed79 » Thu May 18, 2017 2:33 am

I want to be as specific as possible to make it efficient.
From the good (more specific) to the bad (can cause fp's) ...

Code: Select all

||www.google.com/bla/AD.PNG
||ads.google.com/bla/AD.PNG
||google.ca/bla/AD.PNG
||adsbygoogle.com/bla/AD.PNG

Code: Select all

||google.com/bla/AD.PNG|
||google.ca/bla/AD.PNG|
||adsbygoogle.com/bla/AD.PNG|

Code: Select all

||google.com^*/AD.PNG|
||google.ca^*/AD.PNG|
||adsbygoogle.com^*/AD.PNG|

Code: Select all

||google.*/bla/AD.PNG|
||adsbygoogle.com/bla/AD.PNG|

Code: Select all

||google.*/AD.PNG|
||adsbygoogle.com/bla/AD.PNG|

Code: Select all

||google.*/AD.PNG|
||adsbygoogle.*/AD.PNG|

Code: Select all

google.*/bla/AD.PNG|

Code: Select all

google.*/AD.PNG|

Code: Select all

google*/AD.PNG|

Code: Select all

google*AD.PNG
Adblock plus filter cheatsheet https://adblockplus.org/filter-cheatsheet
filter syntax https://forums.lanik.us/viewtopic.php?p=113220#p113220
•► Before posting, to find your answer fast, read Forum « RULES » and use « Search »
••► Don't post clickable links » use inline text bbcode notation « [ C ] » or « [ code ] »

adbob
New Member
New Member
Posts: 3
Joined: Wed May 17, 2017 7:51 pm
Reputation: 0

Post by adbob » Thu May 18, 2017 9:05 pm

Thank you kind sir. Is there a reason this wouldn't work?

Code: Select all

google*/AD.PNG|
Edit: I mean to say

Code: Select all

||google*/AD.PNG|
Has anyone built a simple online tester that I can use, it would save me some development time.

Thank you

User avatar
smed79
Liste AR Author
Liste AR Author
Posts: 11527
Joined: Sun Jan 17, 2010 4:00 am
Reputation: 88
Location: EasyList Forum

Post by smed79 » Thu May 18, 2017 9:25 pm

adbob wrote:Is there a reason this wouldn't work?

Code: Select all

||google*/AD.PNG|
Will work but block also :

Code: Select all

http://googlemaps.com/help/ad.png
http://google.wikipedia.org/images/ad.png
http://google.msn.com/autopromo/ad.png
http://www.googletips.com.us/ad.png
http://anydomain.google/ad.png
adbob wrote:Has anyone built a simple online tester that I can use, it would save me some development time.

Code: Select all

http://htmledit.squarefree.com/
http://codemagic.gr/
http://liveweave.com/
http://jsbin.com/?html,output
https://jsfiddle.net/
http://www.cssdesk.com/
http://plnkr.co/edit/
http://dabblet.com/
•► Before posting, to find your answer fast, read Forum « RULES » and use « Search »
••► Don't post clickable links » use inline text bbcode notation « [ C ] » or « [ code ] »

Post Reply