RE: [PHP] ereg problem
| From: | Maxim Maletsky | Date: | Fri, 16 Feb 2001 03:20:04 +0000 |
| Subject: | RE: [PHP] ereg problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-40085@lists.php.net to get a copy of this message | ||
- 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:janetv@systech.com]
Sent: Thursday, February 15, 2001 3:21 AM
To: 'php-general@lists.php.net'
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: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net