开发者

xcode regular search/replace bug?

I am attempting to refactor some old code, and want to replace [self.* release]; with self.* = nil; where * is some property name.

I am using a regular expression search like (\[self\.)(\w)+[\s](release\]) and for the replacement text I am using self.\2 = nil. This all goes fine (180 results, yay) but when I preview (or perform the replace), the result only copies the开发者_StackOverflow last letter of the \w token.

For example, [self.property release]; would become self.y = nil;. Anyone know what is up here?

Thanks


I know this is little bit old, but I wanted this and solved it like below

(\[self\.)(.*)( release\])


Try: (\[self\.)(\w)*[\s](release\])

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜