Title |
Test
Find
All Country Phone number regular expression
|
Expression |
^\+?\d{2}|\0(?:\-?|\ ?)(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$ |
Description |
This regular expression validates all country phone number formats with country code, plus(+) sign, allowed brackets('(', ')'), dots(.), dashes(-).
Plus (+) and country code is optional.
Above expression allows alphabetical characters. To prevent alphabetical characters first check with this expression /^[^a-z]+$/i then check the main expression. |
Matches |
+91 999 888 7777, 999 888 7777, 9998887777, +91 (999) 888 7777, (999) 888-7777 | 999-888-7777 |
Non-Matches |
Doesn't allow alphabetic characters | 0010011212 | 1991991212 | 123) not-good |
Author |
Rating:
Ankur Raiyani
|
Source |
|
Your Rating |
|
Title: All required functionality
Name: Davide Bernado
Date: 9/24/2014 3:58:02 AM
Comment:
This expression has fulfilled my all requirements for phone number validation.
Thanks Ankur. This is the best.
Title: All required functionality
Name: Davide Bernado
Date: 9/24/2014 3:57:52 AM
Comment:
This expression has fulfilled my all requirements for phone number validation.
Thanks Ankur. This is the best.
Title: All required functionality
Name: Davide Bernado
Date: 9/24/2014 3:57:37 AM
Comment:
This expression has fulfilled my all requirements for phone number validation.
Thanks Ankur. This is the best.