Page 1 of 1

Help with regex for bots

Posted: Thu Jun 22, 2006 11:33 am
by osiris
Hi everyone,

I've had this flood of spambots on my network recently and I've been trying to write a regex that is going to kill them but not kill some other users.

Example bot nicks:

philipmM54
josieafF22
markasP07

etc

I want a regex that is going to kill nicknames that have a capital letter and 2 numbers in the last part of the nickname killed.

The regex I wrote is:
[A-Z]{1}[0-9]{2}!

And I've tried:
^[A-Z]{1}[0-9]{2}!

and also:
^\w+[A-Z]{1}[0-9]{2}!

All will kill the bots but also kill nicknames such as

snowman01
Scrawl07
Tunix21

Any ideas? I do not want to kill nicknames that end in 2 numbers but 1 capital AND 2 numbers.

By the way I am entering these by the /spamfilter command not by putting them in the .conf file

Any help is muchly appreciated!

Posted: Thu Jun 22, 2006 11:40 am
by Dukat
The documentation clearly states that spamfiler are case insensitive.
If you want them to be case sensitive, you have to turn case insensitivity off with (?-i).
http://www.vulnscan.org/UnrealIRCd/unre ... #regexcase

So you could try something like

Code: Select all

^[a-z]+(?-i:[A-Z])[0-9]{2}!
(Caution: Completely untested!)