Skip to content

Instantly share code, notes, and snippets.

@ricardobrg
Created May 10, 2017 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricardobrg/d0b1d2c0830e318142274e7946a7d44e to your computer and use it in GitHub Desktop.
Save ricardobrg/d0b1d2c0830e318142274e7946a7d44e to your computer and use it in GitHub Desktop.
Java Phone Validation BR
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