在 Atom 中选择所有找到的 RegEx 结果 [英] Select all found RegEx results in Atom
问题描述
我试图选择正则表达式找到的所有结果,以便我可以修改它们(不要用文本替换它们!),例如,用 Cmd + K ->Cmd + U
.我知道我可以通过重复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/right shift/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屋!