One Word Regex

These are old archives. They are kept for historic purposes only.
Post Reply
Unholies
Posts: 2
Joined: Thu May 03, 2007 8:38 am

One Word Regex

Post by Unholies »

Hello i come across with a kind of bot attack.

Bots only writes one word. like " a "

Such As;

<k_nDm> a

How can i write a regex for only one word? but if the word has other words next to it, it will not block the message...

so if someone writes "ab" then it wont be blocked.

anybody can help?
Jobe
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Post by Jobe »

So basically you want to block 1 character only messages?

The regular expression to do that would be "^.$" (without the quotes) where that will match any 1 character message where the 1 character can be anything including spaces and special characters.
Unholies
Posts: 2
Joined: Thu May 03, 2007 8:38 am

Post by Unholies »

That didnt work...

Seems Like there is a space before a

I am really a newbie about this :(
Jobe
Official supporter
Posts: 1180
Joined: Wed May 03, 2006 7:09 pm
Location: United Kingdom

Post by Jobe »

If its always a space in front try somthing like "^..$" or "^ .$"
LimE
Posts: 2
Joined: Tue May 15, 2007 2:32 am

Post by LimE »

not sure but it will be ok :P

/spamfilter + cpnN block - test (^\s.\s$|^\s.$|^.\s$|^.$)






--------------------

IRC Network [ irc.globalogc.org ]
Website [ http://www.globalogc.org ]
Email [ [email protected] ]
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Post by Stealth »

Code: Select all

^\s?.\s?$
Post Reply