Created
May 10, 2017 16:36
-
-
Save ricardobrg/d0b1d2c0830e318142274e7946a7d44e to your computer and use it in GitHub Desktop.
Java Phone Validation BR
This file contains 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
public boolean isTelefone(String numeroTelefone) { | |
return numeroTelefone.matches(".((10)|([1-9][1-9]).)\\s[9][6-9][0-9]{3}-[0-9]{4}") || | |
numeroTelefone.matches(".((10)|([1-9][1-9]).)\\s[2-5][0-9]{3}-[0-9]{4}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment