Bug with Regex?

Everything about using Adblock Plus on Mozilla Firefox, Thunderbird and SeaMonkey
Post Reply
Guest

Bug with Regex?

Post by Guest »

The regular expression /ads/ should filter everything containing the letters ads.

But with the lastest dev-builds this doesn't happen (stable is OK).

test-picture:
Image
http://images.apple.com/support/downlo[b]ads[/b]/images/promo_ipod.gif
Guest

Post by Guest »

I think adblock interprets /ads/ literally as /ads/ in the latest version for reasons unknown but! /*ads*/ doesn't work at all and /.*ads.*/ works, so there is a bug, or a change.
User avatar
mcm
Posts: 359
Joined: Sat Jun 10, 2006 2:36 am

Post by mcm »

Is this still happening in 0.5.9.20051016?
Guest

Post by Guest »

Nope, doesn't happen anymore with Version 0.5.9.20051016. Now it works like it should: Image gets blocked. :) Thanks.

What was the reason?
User avatar
mcm
Posts: 359
Joined: Sat Jun 10, 2006 2:36 am

Post by mcm »

Guest

Post by Guest »

so how do you block /ads/ without /comraaaaaaaads/ /combads/ ect being blocked /ads/ treated as literal
User avatar
mcm
Posts: 359
Joined: Sat Jun 10, 2006 2:36 am

Post by mcm »

In regular expressions '\W' matches any character except alphabet characters or the underscore character, so:

"/\Wads\W/"

Will block:

"http://service/ads/test..."

But not:

"http://serviceads/test..."

Because '\W' matches the '/' character either side of ads in the first URL but not 'e' in front of ads in the second URL. Is that what you were asking?
Guest

Post by Guest »

*/ads/* i would think.
Guest

Post by Guest »

both solutions work
Post Reply