iOS 之邮箱判断

//邮箱正则表达式

-(BOOL)isValidateEmail:(NSString *)email;

 

- (BOOL)isValidateEmail:(NSString *)email {

    NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";

    NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];

    return [emailTest evaluateWithObject:email];

}

posted @ 2015-12-31 14:10  紫曦  阅读(161)  评论(0编辑  收藏  举报