中文正则表达式

2015-07-23  本文已影响159人  MindTheGap

#pragma mark 中文判断
+ (BOOL)isValidateChinese:(NSString *)chinese
{
    NSString * phoneRegex = @"^[\u4E00-\u9FA5]*$";  //中文正则表达式
    NSPredicate * chinesePred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", phoneRegex];
    return [chinesePred evaluateWithObject:chinese];
}

上一篇 下一篇

猜你喜欢

热点阅读