Skip to content

Commit 560aebf

Browse files
authored
Create telephonenumbervalidatore.js
1 parent 7770164 commit 560aebf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function telephoneCheck(str) {
2+
return /^(1\s|1)?(\(\d{3}\)|\d{3})(-|\s)?\d{3}(-|\s)?\d{4}$/.test(str)
3+
}
4+
5+
telephoneCheck("555-555-5555");

0 commit comments

Comments
 (0)