Word sequence

These are old archives. They are kept for historic purposes only.
Post Reply
deshikotha
Posts: 8
Joined: Mon Apr 25, 2005 8:56 am

Word sequence

Post by deshikotha »

What will be the regexp to block a specific word with any syntex,
i.e.
someword
s o m e w o r d
so me wo rd
s_o_m_e_w_o_r_d
(s)(o)(m)(w)(o)(r)(d)

anyhow if they use that word with any syntex it will be blocked, Shall i use some thing like *s*o*m*e*w*o*r*d* ? Thats what i use in ban nick block in unrealircd.conf

Can anyone help me out?

Thanks.
deshikotha
Posts: 8
Joined: Mon Apr 25, 2005 8:56 am

Post by deshikotha »

Well i tried this command:

/spamfilter add cpnda gline - - *s*o*m*e*w*o*r*d*

The resault was

-irc.deshikotha.com- Error in regex '*s*o*m*e*w*o*r*d*': Regular expression is too broad
w00t
Posts: 1136
Joined: Thu Mar 25, 2004 3:31 am
Location: Nowra, Australia

Post by w00t »

Read the documentation. It clearly states that regular expressions are not the same as glob matching (ie wildcards, what you're using).

try /spamfilter add cpnda gline - - ^.*s.*o.*m.*e.*w.*o.*r.*d$

(excuse my poor regex skills guys, feel free to correct me.)
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
deshikotha
Posts: 8
Joined: Mon Apr 25, 2005 8:56 am

Post by deshikotha »

Thats perfect working fine.

Thank you w00t.
deshikotha
Posts: 8
Joined: Mon Apr 25, 2005 8:56 am

Post by deshikotha »

I need another information

The solution is perfect. but the problem is when some one add something infront of it or after it spamfilter is not doing anything. i.e.
i have added word "someword" in spam filter. but if some one type irc.someword.com spamfilter not doing anything. Is there any solution?

Thanks.
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Post by Stealth »

Take the ^ and $ off the regex.
w00t
Posts: 1136
Joined: Thu Mar 25, 2004 3:31 am
Location: Nowra, Australia

Post by w00t »

I put them there to reduce the likelyhood of false matches.
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Post by Stealth »

Actually, you didn't need those to prevenet false posatives... All you needed is:

Code: Select all

s.?o.?m.?e.?w.?o.?r.?d
w00t
Posts: 1136
Joined: Thu Mar 25, 2004 3:31 am
Location: Nowra, Australia

Post by w00t »

Yes, but then what stops things like:
so43meword
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Post by Stealth »

If you see any of those, add more .?

You don't want .*, because that can create many false posatives... such as "f.*u.*c.*k" will block such things as "firetruck", as "f.?u.?c.?k" won't.
w00t
Posts: 1136
Joined: Thu Mar 25, 2004 3:31 am
Location: Nowra, Australia

Post by w00t »

True... but... >.>. Ok. Maybe the docs should then be changed to reflect a recommendation of ? over *?
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]
Stealth
Head of Support
Posts: 2085
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Post by Stealth »

Maybe...
deshikotha
Posts: 8
Joined: Mon Apr 25, 2005 8:56 am

Post by deshikotha »

Thank you stealth and w00t

I am using s.?o.?m.?e.?w.?o.?r.?d regexp. I think its perfect for me.
Post Reply