Use regexp within some div values

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
Mpa3uk
Posts: 1
Joined: Thu Feb 11, 2016 11:57 pm

Use regexp within some div values

Post by Mpa3uk »

I have a filter
site.com##div[id="xxxxx"][style="display: block;"]
And it works repfectly with an element like this:
<div style="display: block;" id="xxxxx">
But when i try to use some regexp, like:
site.com##div[id="*"][style="display: block;"] or
site.com##div[id=*][style="display: block;"] or
site.com##div[id="?xxxx"][style="display: block;"]
and so on, this filter not blocks and add. Could some1 point at my mistake, where i go wrong?

Also, i'd want to use an exception for some ads, but with @@||, placed be4 the original filter, it keeps blocking.
lewisje
Posts: 2743
Joined: Mon Jun 14, 2010 12:07 pm

Re: Use regexp within some div values

Post by lewisje »

Element-hiding exceptions use #@# instead of ##, and @@ is just for ordinary exception rules.

Element-hiding rules do not use regular expressions: Instead, whatever comes after the ## or #@# must be a valid CSS selector, so you could try something like
[id^="x"] (starts with)
[id$="xx"] (ends with)
[id*="x"] (contains)
and I admit, this is a bit limiting.
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
Locked