NSString *regex4 =@"^(?=.*[\\W\\_]+.*)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{1,10}$";
NSPredicate *pred4 = [NSPredicatepredicateWithFormat:@"SELF MATCHES %@", regex4];
BOOL isMatch4 = [pred4 evaluateWithObject:string];
return isMatch4;
NSString *regex4 =@"^(?=.*[\\W\\_]+.*)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{1,10}$";
NSPredicate *pred4 = [NSPredicatepredicateWithFormat:@"SELF MATCHES %@", regex4];
BOOL isMatch4 = [pred4 evaluateWithObject:string];
return isMatch4;
本文标题:正则判断字符串包含数字、字母、特殊字符串
本文链接:https://www.haomeiwen.com/subject/erdyjftx.html
网友评论