//判断result 是 “a”,“r”,“s” 中的一个 返回yes,表示 包含, no, 表示不包含
+ (BOOL)isHandel:(NSString *)result{
NSString *regex = @"[ARS]";
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
BOOL contain = [predicate evaluateWithObject:result];
return contain;
}
http://iphone.xiaoxiaostudio.net/2012/11/23/nspredicate-predicatewithformat方法支持的格式/
参考 正则表达式语法