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]使用正则表达式
最新推荐文章于 2024-10-22 17:38:52 发布