Re: LOL, preg_match still not working.

From: Date: Sat, 17 Feb 2007 15:33:15 +0000
Subject: Re: LOL, preg_match still not working.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-248975@lists.php.net to get a copy of this message
As far as I tested, the regular expression works how it is intended to work. Maybe this a touch easier to read line do it for you: elseif (preg_match('|[^a-zA-Z0-9!?@#$%^&*();:_.\\\\ /\t-]|', $comment)) On Sat, Feb 17, 2007 at 09:27:59AM -0500, Beauford wrote: > Hi, > > I previously had some issues with preg_match and many of you tried to help, > but the same problem still exists. Here it is again, if anyone can explain > to me how to get this to work it would be great - otherwise I'll just remove > it as I just spent way to much time on this. > > Thanks > > Here's the code. > > if(empty($comment)) { $formerror['comment'] = nocomments; > } > elseif(!preg_match('|^[a-zA-Z0-9!?@#$%^&*();:_.\\\\ /\t-]+$|', > $comment)) { > $formerror['comment'] = invalidchars; > } > > This produces an error, which I believe it should not. > > Testing 12345. This is a test of the emergency broadcast system. > > WAKE UP!!!!!! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#248975) next »