我正在使用:
+ (BOOL)isPassword:(NSString*)password {
NSString* pattern = @"^(?=.{6,20}$).*$";
NSPredicate* predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", pattern];
return [predicate evaluateWithObject:password];
}
但它返回是的""
。有小费吗?