//
//  NSString+verify.m
//  RuiYuRealEstate
//
//  Created by coderYK on 2018/9/5.
//  Copyright © 2018年 coderYK. All rights reserved.
//

#import "NSString+verify.h"

@implementation NSString (verify)

- (BOOL)isPhoneNum {
    NSString *regex = @"^1[0-9]{10}$";//11位手机号码
    NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
    return [pred evaluateWithObject:self];
}

- (BOOL)isPwd {
    NSString * regex = @"^[A-Za-z0-9]{6,16}$";//6-16位数字字母 ^[A-Za-z0-9]{6,15}$
    NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
    return [pred evaluateWithObject:self];
}

@end
