Android 使用正则表达式验证邮箱格式是否正确
/** * 验证邮箱格式是否正确 */ public boolean emailValidation(String email) { String regex = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; return email.matches(regex); }
/** * 验证邮箱格式是否正确 */ public boolean emailValidation(String email) { String regex = "\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*"; return email.matches(regex); }