We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f276542 commit 4686c46Copy full SHA for 4686c46
Projects/Telephone-Number-Validator.js
@@ -0,0 +1,8 @@
1
+var re =
2
+ /^([+]?1[\s]?)?((?:[(](?:[2-9]1[02-9]|[2-9][02-8][0-9])[)][\s]?)|(?:(?:[2-9]1[02-9]|[2-9][02-8][0-9])[\s.-]?)){1}([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2}[\s.-]?){1}([0-9]{4}){1}$/;
3
+
4
+function telephoneCheck(str) {
5
+ return re.test(str);
6
+}
7
8
+telephoneCheck('555-555-5555');
0 commit comments