- hyphen is something a bit special in RegEx ..
read the manual, I think you should escape it.
Cheers,
Maxim Maletsky
-----Original Message-----
From: Janet Valade [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 15, 2001 3:21 AM
To: '[EMAIL PROTECTED]'
Subject: [PHP] ereg problem
I am using the following statement to check phone numbers.
if (!ereg("^[0-9\-\+\.\ \)\(]{10,}$",$value)) {
Can anyone tell me why this works for every character except the -. It
doesn't see the hyphen as a valid part of the phone number, even though it
recognizes the other characters, e.g. + or .
Janet
--
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]
--
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]