//正则过滤
NSString *regex = @"^((13[0-9])|(15[^4,\\D])|(18[0,0-9]))\\d{8}$";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
BOOL isMatch = [pred evaluateWithObject:@"手机号"];
//
if (!isMatch) {
//非手机号
}
posted on 2016-01-07 14:10 HL丶 阅读(454) 评论(0) 收藏 举报