选择所有在Atom中找到的RegEx结果 [英] Select all found RegEx results in Atom
问题描述
我正在尝试选择一个正则表达式查找到的所有结果,以便我可以全部修改(不要将它们替换为文本!),例如,将所有结果都大写为Cmd + G, Cmd + K, Cmd + U
一步一步地完成它们,但是对于大文件来说,这根本不切实际或不现实.我也知道使用bash以及其他脚本替代方法,我想找到一种在Atom内执行此操作的方法,很高兴在需要时安装外部库.
I'm trying to select all of the results found by a regex find so I can modify them all (not replace them with text!), for example, making them all uppercase with Cmd + K -> Cmd + U
. I'm aware that I could do them one by one via repeating Cmd + G, Cmd + K, Cmd + U
, but for a large file this simply isn't practical or realistic. I'm also aware of using bash and may other scripting alternatives, I'd like to find a way to do it inside Atom, I'm happy to install an external library if needed.
我尝试过的事情:
-
Cmd + D
,这只会选择该确切字母的下一个实例,而不是与正则表达式匹配的下一个结果. -
Cmd + Shift + G
和替代项(alt/向右移位/ctrl),Cmd + G
选择与正则表达式匹配的下一个结果,方向正确. - 将所有选定的文本更改为唯一的字符串,将其全部突出显示,按
Cmd + Z
并希望它保持选中状态,而不会. - 通过 Atom讨论. >
- 阅读有关该主题的Atom文档
Cmd + D
, this just selects the next instance of that exact letter, not the next result matching the regex.Cmd + Shift + G
and alternatives (alt/right shift/ctrl),Cmd + G
selects the next result matching the Regex, which is in the right direction.- Changing all of the selected text to a unique string, highlighting them all, pressing
Cmd + Z
and hoping it will stay selected, it doesn't. - Lots of Googling and reading though Atom discussions.
- Reading Atom's documentation on the subject
推荐答案
按Alt + Enter
键将选择所有与查找"结果匹配的实例.这也适用于RegEx搜索.
Pressing Alt + Enter
will select all instances matching your Find results. This works for RegEx search also.
来源: https://github.com/atom/find-and-replace/pull/290
这篇关于选择所有在Atom中找到的RegEx结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!