On Tue, 22 May 2001 10:44:42 -0700, Jason Caldwell
([EMAIL PROTECTED]) wrote:
>I'm trying to figure out how to "say" with a Regular Expression how
>to check
>for the following characters in a phone number:
>
>( ) -
>
>with a length between 1 and 20 --
>
>I've tried the following and it doesn't seem to work.
>
>eregi("^([0-9]|\\(|\\)|\\-){1,20}$")

oops, make that:
"^[0-9\\(\\)-]{1,20}$"

note: you don't have to escape the - when its the last char in the
range


>I'm not interested in checking for a completely valid phone
>number... but
>instead checking to see if the phone number is numbers with or
>without the
>( ) - characters. Plus, I think creating a Regex expr that can check
>for US
>and International formats would be too complex.
>
>Thanks.
>Jason
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: php-list-
>[EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to