Bug with Regex?

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

Bug with Regex?

Postby Guest » Sat Oct 15, 2005 9:24 pm

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/downloads/images/promo_ipod.gif
Guest
 

Postby Guest » Sun Oct 16, 2005 12:29 am

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.
Guest
 

Postby mcm » Sun Oct 16, 2005 2:09 am

Is this still happening in 0.5.9.20051016?
User avatar
mcm
 
Posts: 359
Joined: Sat Jun 10, 2006 2:36 am

Postby Guest » Sun Oct 16, 2005 11:07 am

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?
Guest
 

Postby mcm » Sun Oct 16, 2005 12:06 pm

User avatar
mcm
 
Posts: 359
Joined: Sat Jun 10, 2006 2:36 am

Postby Guest » Mon Oct 17, 2005 12:11 am

so how do you block /ads/ without /comraaaaaaaads/ /combads/ ect being blocked /ads/ treated as literal
Guest
 

Postby mcm » Mon Oct 17, 2005 1:44 am

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?
User avatar
mcm
 
Posts: 359
Joined: Sat Jun 10, 2006 2:36 am

Postby Guest » Thu Oct 27, 2005 10:07 pm

*/ads/* i would think.
Guest
 

Postby Guest » Thu Oct 27, 2005 10:29 pm

both solutions work
Guest
 


Return to Adblock Plus for Firefox support

Who is online

Users browsing this forum: ShanaBrum and 9 guests