Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

regex phone number

# Examples of vaild phone numbers it accepts
9054286644
905-428-6644
(905)-428-6644
1-(905)-428-6644
(905)4286644
905 428 6644
12 903 455 6789

# Regex expression
^d{0,3}[- ]?[ ]*[(]?d{3}[)]?[- ]?[ ]*d{3}[- ]?[ ]*d{4}$
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #regex #phone #number
ADD COMMENT
Topic
Name
2+7 =