[SOLVED] regex newbie needs help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
feral_shade
Forum Newbie
Posts: 4
Joined: Thu Aug 19, 2004 12:19 pm

regex newbie needs help

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

preg_match('#^\s+$#s',$text);
[edit: :oops:]
Last edited by feyd on Fri Aug 27, 2004 2:38 pm, edited 1 time in total.
feral_shade
Forum Newbie
Posts: 4
Joined: Thu Aug 19, 2004 12:19 pm

Post by feral_shade »

Thanks :)
Post Reply