Whether to have * or not in this script

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
se224141
Posts: 59
Joined: Thu Nov 20, 2008 8:36 am

Whether to have * or not in this script

Post by se224141 »

.rediff.com/*$script and .rediff.com/$script

Both works in the same way at http://www.rediff.com/.

Why should we then have * in .rediff.com/*$script?
Dr. Evil
Posts: 194
Joined: Fri Sep 08, 2006 3:51 pm

Post by Dr. Evil »

There is no difference. You can use whatever you like better.

Back when I wrote filters for my personal usage, I left the asterisks out, without a specific reason. Now I usually add the * to the start and the end because there might be some subscribers of my subscription thinking that the version without the asterisk does not match in the middle of an url.
User avatar
rick752
Posts: 2709
Joined: Fri Jun 09, 2006 7:59 pm
Location: New York USA
Contact:

Post by rick752 »

There is only ONE instance when you DO need either a beginning OR trailing asterisk.

When you create a rule that both begins and ends with a slash (/), you MUST use an asterisk outside of either the beginning or ending slash .... otherwise ABP will interpret the rule as a 'regular expression" type of rule and not a 'simple expression' rule.

For it to be read as a normal, simple rule, it needs to be like this:
/ad/*

If not, ABP thinks it is a regexp type of rule (begins and ends with a slash) .... and will ignore the slashes and block the string "ad" instead of "/ad/". By adding an asterisk outside of either end, it will tell ABP to create the 'simple rule' of "/ad/" instead.


Outside of that, asterisks are unnecessary at either end for ABP .... wildcards are always implied at either end unless you terminate the address with a bar (|} such as in ' /ads.js| '
loveleeyoungae
Posts: 18
Joined: Tue Nov 04, 2008 1:53 am

Post by loveleeyoungae »

You can read the topic in which I asked everyone here about the right method to block ads.
http://adblockplus.org/forum/viewtopic.php?t=3070
Locked