在 Xcode 8 中使用模式查找和替换 [英] Find and Replace using patterns in Xcode 8

查看:28
本文介绍了在 Xcode 8 中使用模式查找和替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图更新

这给了我这样的模式匹配:

但是在 Xcode 8 中,绿色气泡没有出现.我得到一个 (\w+) 但它不再匹配 Textual 样式中的任何内容.当我使用正则表达式匹配样式时,我不再拥有所有漂亮的插入模式提示.

我做错了什么?

注意:我不是在要求正则表达式的答案.我在问如何让插入模式提示起作用.

解决方案

您将查找选项 Matching StyleText 切换为 Regular Expression.要还原此设置,只需单击搜索字段旁边的放大镜,选择 Edit find options... 并将 Matching Style 设置回文本.

I was trying to update one of my old Xcode 7 answers that described how to do regular expression matching. However, I can't get the Textual Matching Style to work now. In Xcode 7, I could do something like this:

which gave me pattern matching like this:

But in Xcode 8 the green bubbles don't show up. I get a (\w+) but that doesn't match anything in the Textual style anymore. And when I am in The Regular Expression Matching Style, I don't have all the nice Insert Pattern hints anymore.

What am I doing wrong?

Note: I'm not asking for the regex answer. I'm asking how to get the Insert Pattern hints to work.

解决方案

You switched your find options Matching Style from Text to Regular Expression. To revert this, simply click on the magnifying glass next to the search field, select Edit find options... and set the Matching Style back to text.

这篇关于在 Xcode 8 中使用模式查找和替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆