@H_502_0@ if ([self isValidateEmail:@"输入你要验证的邮箱"] == YES) { @H_502_0@ NSLog(@"邮箱正确"); @H_502_0@ }else{ @H_502_0@ NSLog(@"邮箱错误"); @H_502_0@ }
@H_502_0@}
/*手机号码验证 MODIFIED BY HELENSONG*/
@H_502_0@-(BOOL) isValidateMobile:(NSString *)mobile @H_502_0@{//手机号以13, 15,18开头,八个 \d 数字字符
NSString *phoneRegex = @"^((13[0-9])|(15[^4,\\D])|(18[0,0-9]))\\d{8}$";
NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",phoneRegex];
//NSLog(@"phoneTest is %@",phoneTest);
@H_502_0@ return [phoneTest evaluateWithObject:mobile]; @H_502_0@}
/*车牌号验证 MODIFIED BY HELENSONG*/
@H_502_0@BOOL validateCarNo(NSString* carNo) @H_502_0@{NSString *carRegex = @"^[A-Za-z]{1}[A-Za-z_0-9]{5}$";
NSPredicate *carTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",carRegex];
NSLog(@"carTest is %@",carTest);
@H_502_0@ return [carTest evaluateWithObject:carNo]; @H_502_0@}
/*邮箱验证 MODIFIED BY HELENSONG*/
@H_502_0@-(BOOL)isValidateEmail:(NSString *)email @H_502_0@{NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",emailRegex];
@H_502_0@ return [emailTest evaluateWithObject:email]; @H_502_0@}