Page 1 of 1

regex newbie needs help

Posted: Fri Aug 27, 2004 1:30 pm
by feral_shade
Hi,

I am a n00b when it comes to regexes, and I need a way to do the following: I have a simple forum and I need a regex to check to see if a particular field contains only whitespace. Can anyone help me out with this? Thanks.

Posted: Fri Aug 27, 2004 1:35 pm
by feyd

Code: Select all

preg_match('#^\s+$#s',$text);
[edit: :oops:]

Posted: Fri Aug 27, 2004 2:23 pm
by feral_shade
Thanks :)