Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. public static boolean esEmail(String correo)
  2. {
  3. Pattern pat = null;
  4. Matcher mat = null;
  5. pat = Pattern.compile("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$");
  6. mat = pat.matcher(correo.trim());
  7. if (mat.find()) {
  8. return true;
  9. }else{
  10. return false;
  11. }
  12. }
  13.  
  14. pat = Pattern.compile("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@+(\sitio.com)$");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement