Skip to main content
Inspiring
July 18, 2008
Question

Phone Validation

  • July 18, 2008
  • 3 replies
  • 589 views
I have this : REFindNoCase("^[2-9]\d{2}-\d{3}-\d{4}$" and it takes some number like 222-222-2222 or 333-333-3333 but not 111-111-1111

Can anyone have any example for phone validation?

Thanks
This topic has been closed for replies.

3 replies

Participant
January 29, 2010

You can use the following RegExp

/^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,5})|(\(?\d{2,6}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$/

it works on phone number lookup service (www.everycall.us)

Inspiring
January 29, 2010

What if the phone number is not a United States one?

--

Adam

Inspiring
July 19, 2008
That looks fine to me!
Inspiring
July 19, 2008
Pretty sure phone number area codes will not start with a 1

--
Ken Ford
Adobe Community Expert - Dreamweaver/ColdFusion
Fordwebs, LLC
http://www.fordwebs.com


"kt03" <webforumsuser@macromedia.com> wrote in message news:g5qu0c$djk$1@forums.macromedia.com...
>I have this : REFindNoCase("^[2-9]\d{2}-\d{3}-\d{4}$" and it takes some number like 222-222-2222 or 333-333-3333 but not
>111-111-1111
>
> Can anyone have any example for phone validation?
>
> Thanks