Android Utililty Methods Email String Validate

List of utility methods to do Email String Validate

Description

The list of methods to do Email String Validate are organized into topic(s).

Method

booleanisEmail(String email)
if email is valid
if (email == null || email.trim().length() == 0)
    return false;
return emailer.matcher(email).matches();
booleanvalidEmail(String email)
valid Email
Pattern pattern = Patterns.EMAIL_ADDRESS;
return pattern.matcher(email).matches();
booleancheckEmail(String email)
check Email
Pattern pattern = Pattern
        .compile("^\\w+([-.]\\w+)*@\\w+([-]\\w+)*\\.(\\w+([-]\\w+)*\\.)*[a-z]{2,3}$");
Matcher matcher = pattern.matcher(email);
if (matcher.matches()) {
    return true;
return false;
booleanisEmail(String str)
is Email
if (StringUtil.isEmpty(str)) {
    return false;
String check = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
final Pattern p = Pattern.compile(check);
final Matcher m = p.matcher(str);
return m.matches();
booleanisEmail(String strEmail)
is Email
String strPattern = "[a-zA-Z0-9_-]+@\\w+\\.[a-z]+(\\.[a-z]+)*";
Pattern p = Pattern.compile(strPattern);
Matcher m = p.matcher(strEmail);
return m.matches();
booleanisEmail(String string)
is Email
Pattern pattern = Pattern
        .compile("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
Matcher matcher = pattern.matcher(string);
if (matcher.find()) {
    return true;
} else {
    return false;
booleanisEmail(String strEmail)
is Email
String strPattern = "^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$";
Pattern p = Pattern.compile(strPattern);
Matcher m = p.matcher(strEmail);
return m.matches();
StringgetNameFromEmail(String email)
get Name From Email
String nameAddr[] = email.split("@");
return nameAddr[0];
booleanisLegalEmail(String email)
is Legal Email
String strPattern = "^[a-zA-Z0-9][a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]"
        + "@[a-zA-Z0-9][a-zA-Z0-9\\-_]*[a-zA-Z0-9]\\."
        + "([a-zA-Z0-9][a-zA-Z0-9\\-_]*[a-zA-Z0-9]\\.)*[a-zA-Z0-9]*$";
Pattern p = Pattern.compile(strPattern);
Matcher m = p.matcher(email);
return m.matches();
booleanisEmail(String str)
is Email
Pattern pattern = Pattern.compile(
        "[a-zA-Z0-9._-]+@[a-z]+\\.+[a-z]+",
        Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(str);
if (matcher.matches()) {
    return true;
} else {
    return false;
...