@Test public void testIsEmail() { assertTrue(ValidatorUtil.isEmail("email_1@email.com")); assertTrue(ValidatorUtil.isEmail("email_email@email.com.ph")); assertTrue(ValidatorUtil.isEmail("email.email@email.com.ph")); assertFalse(ValidatorUtil.isEmail("email.email@email@com.ph")); assertFalse(ValidatorUtil.isEmail("email.emailemail.com.ph")); assertFalse(ValidatorUtil.isEmail("email.emailemail.com.ph@")); assertFalse(ValidatorUtil.isEmail("a.com")); assertFalse(ValidatorUtil.isEmail("")); }
public static boolean isEmail(String email) { if (StringUtil.isEmpty(email)) return false; String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$"; return isMatchRegex(email, expression); }
ValidatorUtil { public static boolean isEmail(String email) { if (StringUtil.isEmpty(email)) return false; String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$"; return isMatchRegex(email, expression); } }
ValidatorUtil { public static boolean isEmail(String email) { if (StringUtil.isEmpty(email)) return false; String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$"; return isMatchRegex(email, expression); } private  ValidatorUtil(); }
ValidatorUtil { public static boolean isEmail(String email) { if (StringUtil.isEmpty(email)) return false; String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$"; return isMatchRegex(email, expression); } private  ValidatorUtil(); static boolean isEmail(String email); static boolean isPhoneNumber(String phoneNumber); static boolean isMatchRegex(String input, String regex); static boolean isNumeric(String number); static boolean isValidDateRange(Date dateField1, Date dateField2, String dateFormat); }
ValidatorUtil { public static boolean isEmail(String email) { if (StringUtil.isEmpty(email)) return false; String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[A-Z]{2,4}$"; return isMatchRegex(email, expression); } private  ValidatorUtil(); static boolean isEmail(String email); static boolean isPhoneNumber(String phoneNumber); static boolean isMatchRegex(String input, String regex); static boolean isNumeric(String number); static boolean isValidDateRange(Date dateField1, Date dateField2, String dateFormat);  }