Skip to content

Commit 4686c46

Browse files
Completed Task
1 parent f276542 commit 4686c46

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)