On 18/07/06, Rick DeNatale rick.denatale@gmail.com wrote:
On 7/18/06, Dan Davis hokie99cpe+wiki@gmail.com wrote:
On 7/18/06, Rotem Liss mail@rotemliss.com wrote:
Andy Roberts wrote:
I wanted to make one which catches all external links to sites which begin with the number 1 and also end with .org as this is a spam pattern I have been having repeated trouble with recently, but using |1*.org| has the unintended effect of blocking all .orgs
I think |1[a-z.]*.org| should work, but I haven't tested it. The phrase "1*" actaully means "zero or more occurrences of the character 1".
This should get it, I think.
$wgSpamRegex="/1.*.org/";
Which is interpreted as
/1 - the literal characters "/" then "1" followed by .* - a run of zero or more arbitrary characters . - the literal character "." (the backslash is needed to treat . as a literal rather than it's normal meaning of any character org/ - the literal characters "org"
Thanks for replies.
In the end I modified Rotem's suggestion. I tested it using http://ioctl.org/jan/test/regexp.htm and found that it matched with the number "1" anywhere in the top level domain, not just at the start hence:
|.1[a-z.]*.org|
seems to cover it.