xcode 常规搜索/替换错误?
我正在尝试重构一些旧代码,并希望将 [self.* release];
替换为 self.* = nil;
其中 *
是一些属性名称。
我正在使用正则表达式搜索,如 (\[self\.)(\w)+[\s](release\])
,对于替换文本,我使用 self.\ 2 = 零
。这一切都很顺利(180 个结果,是的),但是当我预览(或执行替换)时,结果仅复制 \w 标记的最后一个字母。
例如,[self.property release];
将变为 self.y = nil;
。有人知道这里是什么吗?
谢谢
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 last letter of the \w token.
For example, [self.property release];
would become self.y = nil;
. Anyone know what is up here?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道这有点旧,但我想要这个并解决它,如下所示
I know this is little bit old, but I wanted this and solved it like below
尝试:
(\[self\.)(\w)*[\s](release\])
Try:
(\[self\.)(\w)*[\s](release\])