{
/**
* 手机号码
* 移动:134[0-8],135,136,137,138,139,150,151,157,158,159,182,187,188,1705
* 联通:130,131,132,152,155,156,185,186,1709
* 电信:133,1349,153,180,189,1700
*/
/**
* 中国移动:China Mobile
* 134[0-8],135,136,137,138,139,150,151,157,158,159,182,187,188,1705
*/
NSString * CM = @"^1(34[0-8]|(3[5-9]|5[017-9]|8[278])\\d|705)\\d{7}$";
/*
* 中国联通:China Unicom
* 130,131,132,152,155,156,185,186,1709
*/
NSString * CU = @"^1((3[0-2]|5[256]|8[56])\\d|709)\\d{7}$";
/*
* 中国电信:China Telecom
* 133,1349,153,180,189,1700
*/
NSString * CT = @"^1((33|53|8[09])\\d|349|700)\\d{7}$";
NSPredicate *regextestcm = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",CM];
NSPredicate *regextestcu = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",CU];
NSPredicate *regextestct = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",CT];
if (([regextestcm evaluateWithObject:phoneNumber]==YES)||([regextestct evaluateWithObject:phoneNumber]==YES)||([regextestcu evaluateWithObject:phoneNumber]==YES)) {
return YES;
}else{
return NO;
}
}