Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法使用 TouchXML 来解析未引用键的 json,如下所示:
{ foo:"bar" }
我正在尝试解析来自网络服务(谷歌)的响应,因此简单地将 JSON 代码修复为有效不是一种选择。
如果不可能,有没有办法有效地引用密钥作为预处理步骤?
我决定用 RegexKitLite 预解析它,使用
uint numReplace = [encoded replaceOccurrencesOfRegex:@"(?<=[\\{,])[^:\\[\\{\"]+(?=:)" withString:@"\"$0\""];