Re: [PHP] Regex for telephone numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30/12/2010, at 1:12 PM, Ethan Rosenberg wrote:

> Dear List -
> 
> Thank you for all your help in the past.
> 
> Here is another one....
> 
> I would like to have a regex  which would validate that a telephone number is in the format xxx-xxx-xxxx.
> 
> Thanks.
> 
> Ethan
> 
> MySQL 5.1  PHP 5  Linux [Debian (sid)] 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

\d{3}-\d{3}-\d{4}

Also, have a look at the phoneNumber method in the relevant Validate PEAR package: http://pear.php.net/packages.php?catpid=50&catname=Validate

---
Simon Welsh
Admin of http://simon.geek.nz/

Who said Microsoft never created a bug-free program? The blue screen never, ever crashes!

http://www.thinkgeek.com/brain/gimme.cgi?wid=81d520e5e


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux