adamcannon Posted May 16, 2007 Share Posted May 16, 2007 Hello, I'm trying to check if the $string has anything other than alphanumerics or double quotations. Here is my code: if (preg_match('^[a-zA-Z0-9"]', $string)) { echo "Only alphanumerics and double quotations are allowed."; } Does the syntax look remotely correct? I'm getting this error as well: Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in /home/mysite/test.php on line 7 Thanks, adam. Quote Link to comment Share on other sites More sharing options...
effigy Posted May 16, 2007 Share Posted May 16, 2007 As the error hints, you need delimiters. You also need to modify your pattern to negate the character class. /[^a-zA-Z0-9"]/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.