Case insensitive filter

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

Case insensitive filter

Post by General »

I wonder if there is trick or workaround to create case insensitive filters.

For example if I want to filter all ids with the name of advert regardless of its case. In other words, all of the following would match: ADVERT, Advert, ADvert, advert, AdVert and so on.

What should I do?
MonztA
ABP Developer
Posts: 3957
Joined: Mon Aug 14, 2006 12:18 am
Location: Germany

Post by MonztA »

http://adblockplus.org/en/filters#optio ... match-case — makes the filter only apply to addresses with matching letter case, e.g. the filter */BannerAd.gif$match-case will block http://example.com/BannerAd.gif but not http://example.com/bannerad.gif.[/quote]
General

Post by General »

MonztA wrote:http://adblockplus.org/en/filters#optio ... match-case — makes the filter only apply to addresses with matching letter case, e.g. the filter */BannerAd.gif$match-case will block http://example.com/BannerAd.gif but not http://example.com/bannerad.gif.
[/quote]

Hmm... As far as I know element hiding rules and normal ad blocking rules behave differently. The default for element hiding rules is case sensitive.
Wladimir Palant

Post by Wladimir Palant »

As explained before, element hiding rules depend on CSS - you cannot do anything with them that you cannot do with CSS.
MonztA
ABP Developer
Posts: 3957
Joined: Mon Aug 14, 2006 12:18 am
Location: Germany

Post by MonztA »

General wrote:Hmm... As far as I know element hiding rules and normal ad blocking rules behave differently. The default for element hiding rules is case sensitive.
Oh, I missed it that you were talking about Element Hiding Filters.
General

Post by General »

Wladimir Palant wrote:As explained before, element hiding rules depend on CSS - you cannot do anything with them that you cannot do with CSS.
That is the part I don't understand.
All Selectors syntax is case-insensitive within the ASCII range (i.e. [a-z] and [A-Z] are equivalent), except for parts that are not under the control of Selectors. The case sensitivity of document language element names, attribute names, and attribute values in selectors depends on the document language. For example, in HTML, element names are case-insensitive, but in XML, they are case-sensitive.
We are trying to detect HTML pages, aren't we? It should be case insensitive. But the fact is Firefox 2 or below is case insensitive. Firefox 3 or higher is case sensitive. If it only depends on CSS only, why does it have such a strange behavior? I'm confused.

@MonztA
Never mind. :wink:
Ares2
Posts: 1275
Joined: Fri Feb 15, 2008 12:47 pm

Post by Ares2 »

HTML 4.01 defines id and class as case-sensitive: http://www.w3.org/TR/html401/struct/global.html#h-7.5.2

from: https://developer.mozilla.org/en/Case_S ... d_id_Names

The Mozilla document seems rather old though (April 2005), so I don't know why Firefox 2 (October 2006) is still case-insensitive.
Locked