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();
booleanisEmail(String text)
is Email
if (TextUtils.isEmpty(text)) {
    return false;
Pattern pattern = Pattern.compile(regEmail);
Matcher matcher = pattern.matcher(text);
return matcher.find();
booleanisEmailFormat(String email)
is Email Format
return EMAIL_ADDRESS_PATTERN.matcher(email).matches();
booleanisValidEmail(CharSequence target)
is Valid Email
try {
    return android.util.Patterns.EMAIL_ADDRESS.matcher(target)
            .matches();
} catch (NullPointerException exception) {
    return false;
booleanisValidEmailAddress(String email)
Validates an email address
return email.matches(EMAIL_REGEX) && !email.trim().equals("")
        && !email.startsWith(" ") && !email.endsWith(" ");
booleanisEmailValid(CharSequence email)
is Email Valid
boolean isValid = false;
String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$";
Pattern pattern = Pattern.compile(expression,
        Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(email);
if (matcher.matches()) {
    isValid = true;
return isValid;
booleanisEmail(String email)
is 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
Boolean isEmail = false;
String expr = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
if (str.matches(expr)) {
    isEmail = true;
return isEmail;
booleanisEmailValid(String email)
is Email Valid
String regExpn = "^(([\\w-]+\\.)+[\\w-]+|([a-zA-Z]{1}|[\\w-]{2,}))@"
        + "((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?"
        + "[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\."
        + "([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?"
        + "[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|"
        + "([a-zA-Z]+[\\w-]+\\.)+[a-zA-Z]{2,4})$";
CharSequence inputStr = email;
Pattern pattern = Pattern
...
booleancheckMail(String email)
check Mail
String input = "@sun.com";
Pattern p = Pattern.compile("^\\.|^\\@");
Matcher m = p.matcher(input);
if (m.find())
    return false;
p = Pattern.compile("^www\\.");
m = p.matcher(input);
if (m.find()) {
...