element with different cases and numbers

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
General

element with different cases and numbers

Post by General »

Is it possible to block elements which match
id=ad12345
id=Ad12345
class=AD12345

The case of ad is random.
Number is always after ad.
It may use id or class.
The number is random. The length of number is random.

I want to write a generic filter which can block all instances. It would be something like id|class=(ad|Ad|AD) + any number

Please advise. :)
Wladimir Palant

Post by Wladimir Palant »

If I understood correctly:

Code: Select all

##[id$="12345"],[class$="12345"]
User avatar
Hubird
Posts: 2850
Joined: Thu Oct 26, 2006 2:59 pm
Location: Australia
Contact:

Post by Hubird »

The number is random. The length of number is random
If I understand correctly:

##[id$="12345"],[class$="12345"]

The above code will not work with random values.
General

Post by General »

##[id$="12345"],[class$="12345"]
No. The number can be anything. It can be 367, 52345, 3692, 58620, 58602 etc.

This filter is going to be overkilling:

Code: Select all

##[id^="ad"],[class^="ad"]
I would like to restrict it so it matches when the rest of the string consists of numbers only:

Code: Select all

##[id^="ad{any number}"],[class^="ad{any number}"]
What snytax should I use to tell Adblock Plus to match numbers only?

Also how can I make a case insensitive match (matching ad, Ad, AD, aD)?
Wladimir Palant

Post by Wladimir Palant »

There is only so much that CSS can do: http://www.w3.org/TR/css3-selectors/ (attribute selectors are what's relevant here). In other words: no, this isn't possible.
General

Post by General »

Wladimir Palant wrote:There is only so much that CSS can do: http://www.w3.org/TR/css3-selectors/ (attribute selectors are what's relevant here). In other words: no, this isn't possible.
Case insensitive, no? :(
Locked