Page 1 of 1
Word sequence
Posted: Mon Apr 25, 2005 11:39 am
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.
Posted: Mon Apr 25, 2005 11:57 am
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
Posted: Mon Apr 25, 2005 12:19 pm
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.)
Posted: Mon Apr 25, 2005 12:31 pm
by deshikotha
Thats perfect working fine.
Thank you w00t.
Posted: Wed Apr 27, 2005 12:03 am
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.
Posted: Wed Apr 27, 2005 12:39 am
by Stealth
Take the ^ and $ off the regex.
Posted: Wed Apr 27, 2005 5:33 am
by w00t
I put them there to reduce the likelyhood of false matches.
Posted: Wed Apr 27, 2005 5:44 am
by Stealth
Actually, you didn't need those to prevenet false posatives... All you needed is:
Posted: Wed Apr 27, 2005 6:04 am
by w00t
Yes, but then what stops things like:
so43meword
Posted: Wed Apr 27, 2005 6:08 am
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.
Posted: Wed Apr 27, 2005 6:09 am
by w00t
True... but... >.>. Ok. Maybe the docs should then be changed to reflect a recommendation of ? over *?
Posted: Wed Apr 27, 2005 6:12 am
by Stealth
Maybe...
Posted: Wed Apr 27, 2005 5:42 pm
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.