Problem with regular expressions

From: Date: Tue, 25 Jun 2002 07:52:06 +0000
Subject: Problem with regular expressions
Groups: php.general 
Request: Send a blank email to php-general+get-103738@lists.php.net to get a copy of this message
When I run the following script it returns String Okay! when it should say Invalid Characters Found. I've tried the script substituting $ for other characters, such as j, and it works just fine. What do I need to do? <?php $input = "johnon@company.$com"; if (ereg("[$]", $input)) { die("Invalid Characters Found."); } elseif (ereg("[[:space:]]", $input)) { die("Whitespace found."); } else { echo "String okay!"; } ?> Thanks, Drew

« previous php.general (#103738) next »