//邮箱合法
+ (BOOL)xfunc_isEmail:(NSString*)email
{
NSString *regex = @"^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
return [pred evaluateWithObject:email];
}
//邮箱合法
+ (BOOL)xfunc_isEmail:(NSString*)email
{
NSString *regex = @"^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
return [pred evaluateWithObject:email];
}
本文标题:判断邮箱的合法状态
本文链接:https://www.haomeiwen.com/subject/pgnihttx.html
网友评论