Help with regex for bots

These are old archives. They are kept for historic purposes only.
Post Reply
osiris
Posts: 5
Joined: Mon Nov 01, 2004 11:08 pm
Location: Melbourne, Australia
Contact:

Help with regex for bots

Post 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!
That is not dead which can eternal lie, yet with strange eons, even death, may die.

H.P. Lovecraft
Dukat
Posts: 1083
Joined: Tue Mar 16, 2004 5:44 pm
Location: Switzerland

Post 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!)
If you don't make mistakes, you aren't really trying.
- Coleman Hawkins
Post Reply