Ranges do not work

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
Decebal
Posts: 4
Joined: Tue Jul 29, 2008 1:47 pm

Ranges do not work

Post by Decebal »

I put the following filter in my list:

Code: Select all

http://m.[a-z][a-z].2mdn.net/
This did not block a certain add, which was blocked by:

Code: Select all

http://m.uk.2mdn.net/
Is this a bug, or did I make a mistake?
Wladimir Palant

Post by Wladimir Palant »

For character classes you have to use regular expressions, simple filters only support * as a wildcard. The regular expression in that case would be:

Code: Select all

/^http:\/\/m\.[a-z][a-z]\.2mdn\.net\//
However, I would recommend multiple filters like "http://m.uk.2mdn.net/" and "http://m.us.2mdn.net/" instead - these work a lot faster (even if you add a hundred of them instead of one regular expression).
Decebal
Posts: 4
Joined: Tue Jul 29, 2008 1:47 pm

Post by Decebal »

Wladimir Palant wrote:For character classes you have to use regular expressions, simple filters only support * as a wildcard. The regular expression in that case would be:

Code: Select all

/^http:\/\/m\.[a-z][a-z]\.2mdn\.net\//
However, I would recommend multiple filters like "http://m.uk.2mdn.net/" and "http://m.us.2mdn.net/" instead - these work a lot faster (even if you add a hundred of them instead of one regular expression).
Okay, thanks. I did not know that.
Does it make a lot off diference? I would prefer the regular expression. It is clearer and new links are automatically taken care off. (In my case it is about uk and fr.)
Wladimir Palant

Post by Wladimir Palant »

Depends on how many regular expressions you get - 40 already create a noticeable delay (on the other hand, 40000 simple filters don't).
Ares2
Posts: 1275
Joined: Fri Feb 15, 2008 12:47 pm

Post by Ares2 »

Decebal wrote:It is clearer and new links are automatically taken care off. (In my case it is about uk and fr.)
IMO, it's much easier to use a wildcard in this case:

Code: Select all

http://m.*.2mdn.net/
or - as this is a well known adserver - you can block the whole thing:

Code: Select all

.2mdn.net/
This will definitely take care of new links. :wink:
Decebal
Posts: 4
Joined: Tue Jul 29, 2008 1:47 pm

Post by Decebal »

Ares2 wrote:
Decebal wrote:It is clearer and new links are automatically taken care off. (In my case it is about uk and fr.)
IMO, it's much easier to use a wildcard in this case:

Code: Select all

http://m.*.2mdn.net/
or - as this is a well known adserver - you can block the whole thing:

Code: Select all

.2mdn.net/
This will definitely take care of new links. :wink:
Your wildcard is much better yes. Also, if it is only an adserver, then the second solution is even better.
Decebal
Posts: 4
Joined: Tue Jul 29, 2008 1:47 pm

Post by Decebal »

Wladimir Palant wrote:Depends on how many regular expressions you get - 40 already create a noticeable delay (on the other hand, 40000 simple filters don't).
Ath the moment I have 18 filters and one regular expression. So that should not be an problem.
But I'll rewrite the regular expression to a simple filter.
Locked