NSString *string = @"abaaBaaa2.";
//判断是否包含数字
NSString *regex1 = @".*[0-9]+.*";
NSPredicate *pred1 = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex1];
BOOL isMatch1 = [pred1 evaluateWithObject:string];
//判断是否包含小写字母
NSString *regex2 = @".*[a-z]+.*";
NSPredicate *pred2 = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex2];
BOOL isMatch2 = [pred2 evaluateWithObject:string];
//判断是否包含大写字母
NSString *regex3 = @".*[A-Z]+.*";
NSPredicate *pred3 = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex3];
BOOL isMatch3 = [pred3 evaluateWithObject:string];
//判断是否包含符号
NSString * regex4 = @".*[\\W\\_]+.*";
NSPredicate *pred4 = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex4];
BOOL isMatch4 = [pred4 evaluateWithObject:string];