RE: LOL, preg_match still not working.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've been over this a thousand times with various users on this list and
escaping this and escaping that just doesn't matter.

The error is that it thinks valid characters are invalid. In the case of the
example I included, the ! and the period are invalid, which they should not
be.

The nocomments and invalidchars are constants.

Thanks

> -----Original Message-----
> From: Ray Hauge [mailto:ray@xxxxxxxxxxxxxxxxxxxxxxx] 
> Sent: February 17, 2007 9:45 AM
> To: Beauford
> Cc: PHP
> Subject: Re:  LOL, preg_match still not working.
> 
> Maybe you just copied it wrong, but nocomments and 
> invalidchars are not 
> quoted, or they're constants.
> 
> I don't think you have to, but you might need to escape some of the 
> characters (namely * and .) in your regex.  It's been a while, so I'd 
> have to look it up.
> 
> What's the error you are getting?
> 
> Ray Hauge
> Primate Applications
> 
> 
> 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
> 
> 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux