Matt Robertson wrote:

> I'm trying to use this code and it keeps throwing out the string
> whether its valid or not.  I know I'm doing something wrong but am a
> dilettante at best when it comes to regexes.  I also tried Ben Forta's
> phone regex out of his book with similarly bad results, so its
> definitely me doing something stupid here.
>
> ThisRegex="[\(.]?[2-9]\d\d[\).]?[ -]?[2-9]\d\d[-.]\d{4}";

How should a phone number look according to you? You appear to be
after something else as the international standard ITU-T E.164.
E164 is pretty much:

phonenumber := "+" <CC> [" " <NDC>]" " <SN>
<CC> := country code, 1-3 digits
<NDC> := national destination code
<SN> := subscriber number

With the added restriction that <CC> + <NDC> + <SN> is 15 digits
or less.

Jochem
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to