Regular expression for validating phone numbers

The following regular expression will validate phone numbers in all well known formats, such as:

555-12-34
555 12 34
555 1234
555 12-34
5551234
(012) 555-12-34
(012) 555 1234
+1 (012) 555-12-34
+1 (012) 5551234

…and many other similar formats.

/^(\+\d)*\s*(\(\d{3}\)\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top