public static boolean isEmailValid(String value) throws Exception{ // Trim the email id before checking whether it is valid or not. if(value != null && value.equals("")){ return true; }else{ String pattern= "^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$"; // No I18N if(value.matches(pattern)){ return true; }else{ return false; } } }