Last active
May 30, 2021 14:29
-
-
Save sakilk130/c39ac0373ebfe512c8bbfd0cece41f73 to your computer and use it in GitHub Desktop.
FreeCodeCamp JavaScript Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var re = | |
| /^([+]?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}$/; | |
| function telephoneCheck(str) { | |
| return re.test(str); | |
| } | |
| telephoneCheck('555-555-5555'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment