/** * 正则表达式匹配中文 */ - (BOOL)isRegexMatching:(NSString *)str; { NSString *regex = @"^[\u4E00-\u9FFF]+$"; return [[NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex] evaluateWithObject:str]; }
/** * 正则表达式匹配中文 */ - (BOOL)isRegexMatching:(NSString *)str; { NSString *regex = @"^[\u4E00-\u9FFF]+$"; return [[NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex] evaluateWithObject:str]; }
转载于:https://www.cnblogs.com/mgbert/p/4121279.html