Java Utililty Methods Email Validate

List of utility methods to do Email Validate

Description

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

Method

booleanisEmail(String email)
is Email
if (emailPattern == null) {
    String regStr = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
    emailPattern = Pattern.compile(regStr);
return emailPattern.matcher(email).find();
booleanisEmail(String email)
is Email
if (isEmpty(email))
    return false;
return Pattern.matches("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$", email);
booleanisEmail(String email)
Valid Email
String str = "^([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)*@([a-zA-Z0-9]*[-_]?[a-zA-Z0-9]+)+[\\.][A-Za-z]{2,3}([\\.][A-Za-z]{2})?$";
Pattern p = Pattern.compile(str);
Matcher m = p.matcher(email);
return m.matches();
booleanisEmail(String email)
is Email
return isMatch(email, EMAIL_REGEX);
booleanisEmail(String email)
is Email
if (isEmpty(email)) {
    return false;
String str = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$";
Pattern p = Pattern.compile(str);
Matcher m = p.matcher(email);
return m.matches();
booleanisEmail(String emailAddress)
is Email
final String EMAIL_REGEX = "^([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})(\\]?)$";
Pattern pattern = Pattern.compile(EMAIL_REGEX);
Matcher matcher = pattern.matcher(emailAddress);
return matcher.find();
booleanisEmail(String input)
is Email
return tstPattern("^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$", input);
booleanisEmail(String msg)
is Email
Pattern pattern = Pattern
        .compile("^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$");
Matcher matcher = pattern.matcher(msg);
return matcher.matches();
booleanisEmail(String s)
Checks whether s is a valid email address or not.
String regex = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(s + "");
return m.matches();
booleanisEmail(String str)
is Email
Pattern pattern = Pattern.compile("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$");
return pattern.matcher(str).matches();