Displaying page
of
pages;
Items to
Title |
Test
Details
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
|
Displaying page
of
pages;
Items to