Thread
:
preg_match problems
View Single Post
01-18-2006, 04:59 PM
#
2
(
permalink
)
sde
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,532
some of those characters are regular expression characters and need to be escaped with a backslash. this should work.
PHP Code:
if (
preg_match
(
"/[\.\*$?\"\/\|\\:<>]/"
,
$text
) ) {
echo
"match"
;
} else {
echo
"no match"
;
}
sde
View Public Profile
Visit sde's homepage!
Find More Posts by sde