Skip to content

Instantly share code, notes, and snippets.

@Fast0n
Last active June 6, 2018 00:36
Show Gist options
  • Save Fast0n/0573d9fd00fe489fee789f49653d3b57 to your computer and use it in GitHub Desktop.
Save Fast0n/0573d9fd00fe489fee789f49653d3b57 to your computer and use it in GitHub Desktop.
Check Mail Android Studio
/**
* Controllo se il campo è una mail
*/
public static boolean isEmail(String email) {
String expression = "^[\\w\\.]+@([\\w]+\\.)+[A-Z]{2,7}$";
CharSequence inputString = email;
Pattern pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(inputString);
return matcher.matches();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment