
block "hit" but not "white"
block "hit" but not "white"
I haven't been able to accomplish this by using regexp. Any help would be greatly appreciated 

- Adblock Plus Fan
- Posts: 1255
- Joined: Sat Feb 24, 2007 11:08 am
Normally there's the whitelist feature for exceptions, but what you want ('white') is too short and unspecific to recommend for a whitelist.
And regexps are not recommended either, they are very slow compared to normal filters.
And regexps are not recommended either, they are very slow compared to normal filters.
ABP video download trick / Want to help? Test new builds/report bugs you find.
If it is a page element that you want to hide, you can do it like this:
Code: Select all
somesite.com##div[id*="hit"] :not([id*="white"])
added to above
If it is specifically images or graphics that you are trying to do this to, this is how you would hide/allow them:
.... where something in the image's address has "hit" in it .... but it will not hide something with "hit*white" in the address. So that string says to hide anything with "hit" but :NOT if it also contains "white". It acts as an element 'self-whitelisting' rule.
Remember though that this is only 'hiding' them (still downloaded) ... NOT blocking them (not downloaded). So if you just want to do it just for visual impact you can do it this way.
If it is specifically images or graphics that you are trying to do this to, this is how you would hide/allow them:
Code: Select all
somesite.com##img[src*="hit"] :not([src*="white"])
.... where something in the image's address has "hit" in it .... but it will not hide something with "hit*white" in the address. So that string says to hide anything with "hit" but :NOT if it also contains "white". It acts as an element 'self-whitelisting' rule.
Remember though that this is only 'hiding' them (still downloaded) ... NOT blocking them (not downloaded). So if you just want to do it just for visual impact you can do it this way.
The regex:
will match "hit" and not "white", provided "hit" is bounded by additional characters - ie, it will match "/hit/" or "/hitcounter", but it won't match the text "hit" outright.
It'll also match anything that starts with the popular four letter word for fecal matter, so you may want to include "s" in the first block, or be explicit in what bounding chars you expect:
Untested examples of the top of my head.
Enjoy.
Code: Select all
[^w]hit[^e]
It'll also match anything that starts with the popular four letter word for fecal matter, so you may want to include "s" in the first block, or be explicit in what bounding chars you expect:
Code: Select all
[^ws]hit[^e]
[\/\.\?_=\-\&\d\!]hit
Enjoy.