Page 1 of 1

empty string filtering

Posted: Mon Dec 24, 2007 6:49 pm
by Ozy
Hello guys,

What is proper regex to filter out empty characters (spaces) string of any length. More spacific if someone someone post "_" or "____" or "________" etc (_ is space) that would be filtered however when someone go for "_hello" or "_hello_there_" etc that will pass. So for example:

/spamfilter add cN block - Empty_string_detected. <someregex>

What should be used for <someregex> to fit this need? I hope this should be easy for people familiar with regex syntax which unfortunately i'm not.

Many thanks in advance and happy holidays everyone. :)

Re: empty string filtering

Posted: Mon Dec 24, 2007 8:20 pm
by Jobe
Try:
^\s*$

Which will also match "" too.

Re: empty string filtering

Posted: Mon Dec 24, 2007 9:21 pm
by Ozy
Thanks Jobe1986 however:

Error in regex '^\s*$': Regular expression is too broad

I've tried with badword block (with idea to mlock +G later on channels where i need this) but with the same type of error. :/

Re: empty string filtering

Posted: Fri Dec 28, 2007 10:40 pm
by Jason
Match: " {2,}"
Replace: " "

Re: empty string filtering

Posted: Mon Dec 31, 2007 4:01 pm
by Ozy
Solved with "^ {1,}" to "" for what I needed. Many thanks everyone! :)

edit: changed to better and actual solution.