List of utility methods to do Email String Validate
boolean | isEmail(String email) if email is valid if (email == null || email.trim().length() == 0) return false; return emailer.matcher(email).matches(); |
boolean | validEmail(String email) valid Email Pattern pattern = Patterns.EMAIL_ADDRESS;
return pattern.matcher(email).matches();
|
boolean | checkEmail(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; |
boolean | isEmail(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(); |
boolean | isEmail(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(); |
boolean | isEmail(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; |
boolean | isEmail(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(); |
String | getNameFromEmail(String email) get Name From Email String nameAddr[] = email.split("@"); return nameAddr[0]; |
boolean | isLegalEmail(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(); |
boolean | isEmail(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; ... |