NSString * regex = @"^.*\"success\":false{1}.*$"; NSPredicate * pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; BOOL isMatch = [pred evaluateWithObject:@"\"loginCallback({\"sS\":\"101\",\"iI\":false,\"iP\":true,\"success\":false});\""]; NSLog (@"%s", (isMatch) ? "YES" : "NO");
[object-c]使用正则表达式
最新推荐文章于 2016-09-12 09:48:14 发布