note 48548 added to function.preg-match
| From: | php-general at lists dot php dot net | Date: | Wed, 29 Dec 2004 08:44:46 +0000 |
| Subject: | note 48548 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-82435@lists.php.net to get a copy of this message | ||
This is a constant that helps in getting a valid phone number that does not need to be in a
particular format. The following is a constant that matches the following US Phone formats:
Phone number can be in many variations of the following:
(Xxx) Xxx-Xxxx
(Xxx) Xxx Xxxx
Xxx Xxx Xxxx
Xxx-Xxx-Xxxx
XxxXxxXxxx
Xxx.Xxx.Xxxx
define( "REGEXP_PHONE", "/^(\(|){1}[2-9][0-9]{2}(\)|){1}([\.- ]|)[2-9][0-9]{2}([\.-
]|)[0-9]{4}$/" );
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48548
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48548&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48548&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48548&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48548&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48548&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48548&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48548&report=yes
Search -- http://master.php.net/manage/user-notes.php