-
-
Save brunopulis/c2b7be103b5caaa29aae66386114c1bd to your computer and use it in GitHub Desktop.
Valida telefones do Brasil com DDD, o 9º dígito e obrigatoriamente contendo 9 dígitos, mais espaços e caracteres de separação.
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
let regex = /^\([1-9]{2}\) 9 [7-9][0-9]{3}\-[0-9]{4}$/; | |
if( regex.test(c.value) ) { | |
return null; | |
} else { | |
return { phoneError: true }; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment