On Wednesday 20 March 2002 01:53, Thalis A. Kalfigopoulos wrote:
> I guess you can do it also as:
>
> ([1-9]{3})[1-9]{3}-[1-9]{4}
But wouldn't this excludes zeros?
Try:
preg_match("/^\(\d{3}\)\s\d{3}-\d{4}$/", $number)
which matches
(123) 345-6789
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
Your good nature will bring you unbounded happiness.
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

