Kris Vose wrote:
>
> How would you write a regular expression that defines a phone number: ex.
>(123)123-1234.
>
> In other words how would you check to see if there were three numerics surrounded by
>(), then
> three numerics with a "-", then four numerics.
with posix regular expression, for example :
$pattern = "\([0-9]{3}\)[0-9]{3}\-[0-9]{4}";
or
$pattern = "\([0-9]{3}\)[0-9]{3}-[0-9]{4}";
(i m not sure for the -)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php