我正在使用regexkitlite
来验证xcode中我的iPhone应用程序中的某些数据。如何使用正则表达式将语句放在一个语句中
我想提出一个API调用发送的JSON结果:
"taskDate": newDate("September 23, 2011 00:00:00")
如何使用正则表达式将其转换为:
"taskDate": "newDate("September 23, 2011 00:00:00")"
我想围绕着每一个“值taskdate“键带引号。
编辑:添加OP的评论
这里是我使用的是什么:
[resultString replaceOccurrencesOfRegex:@"new Date((.*?)\")," withString:@"\"\"," range:NSMakeRange(0, [resultString length])];
其中resultString是包含了 “新的日期(....”
我注意到你提到了正则表达式并没有替换字符串。我在iOS上使用regexkitlite,它有一个函数“replaceoccurencesofregex”。这里是我正在使用的: [resultString replaceOccurrencesOfRegex:@“new Date((。*?)\”),“withString:@”\“\”,“range:NSMakeRange(0,[resultString length])] ; 其中resultString是包含“新日期(...” – bakwarte
我不熟悉regexkitlite或与iOS一般:)然后使用替换功能它与我写的正则表达式。让男人知道如果你需要更多的帮助:) – apines
我如何提取“<任何可以去这里>的部分,所以我可以从新的日期(033333)改写为”新的日期(033333)“? – bakwarte