【发布时间】:2011-08-30 04:54:58
【问题描述】:
我想将字符串 aaaa{\"type\":\"video\",\"title\":\"a\",manyothershere\"}ssss 替换为 aaaa[视频]ssss
这意味着字符串 {"type":"video","title":"a",balabala"} 到 [video]
我使用 RegexKitLite,我尝试了下面的代码,但它不起作用。
NSString *videoRegexString = @"{\"type\":\"video\",.+\"}";
NSString *replacedStr = [@"aaaa{\"type\":\"video\",\"title\":\"sdf\",manyothershere\"}ssss" stringByReplacingOccurrencesOfRegex:videoRegexString withString:@"[video]"];
我想replacedStr 是“aaaa[video]ssss”,但它是 nil 我错了吗?
【问题讨论】:
标签: iphone regexkitlite