In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Dave) wrote:
> Cannot seem to get a regex to check a string for the following
>
> space tab ' " ! @ # $ % ^ & * ( ) + = : ; / \
>
> if(preg_match('[\'" ,!@#$%\^&*()+=:;/\\]',$mystring))
You need pattern delimiters with preg_* expressions. Right now it's using
your square brackets at the delimiters, so instead of a character class
("match on any of these"), you're trying to match a string matching the
entire sequence of characters between the square brackets. Try:
if(preg_match('|[\'" ,!@#$%\^&*()+=:;/\\]|',$mystring))
--
CC
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]