美文网首页
正则判断字符串包含数字、字母、特殊字符串

正则判断字符串包含数字、字母、特殊字符串

作者: 阑丶夜 | 来源:发表于2018-05-25 10:00 被阅读0次

        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