Last active
January 16, 2024 18:57
-
-
Save berdfandrade/4825dd37c1ad09f9f94e6a0908552d01 to your computer and use it in GitHub Desktop.
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
function telephoneCheck(str) { | |
// Expressão regular que verifica o se o número de telefone é válido. | |
const regexTelefone = | |
/^(1\s?)?(\(\d{3}\)|\d{3})[-\s]?\d{3}[-\s]?\d{4}$/; | |
return regexTelefone.test(str); | |
} | |
telephoneCheck("555-555-5555"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment