在 Atom 中选择所有找到的 RegEx 结果 [英] Select all found RegEx results in Atom

查看:17
本文介绍了在 Atom 中选择所有找到的 RegEx 结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图选择正则表达式找到的所有结果,以便我可以修改它们(不要用文本替换它们!),例如,用 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.

我尝试过的事情:

  1. Cmd + D,这只是选择那个确切字母的下一个实例,而不是匹配正则表达式的下一个结果.
  2. Cmd + Shift + G 和替代项(alt/right shift/ctrl),Cmd + G 选择下一个匹配正则表达式的结果,方向正确.
  3. 将所有选定的文本更改为唯一的字符串,将它们全部突出显示,按 Cmd + Z 并希望它保持选中状态,但事实并非如此.
  4. 通过Atom 讨论进行大量谷歌搜索和阅读.
  5. 阅读 Atom 关于该主题的文档
  1. Cmd + D, this just selects the next instance of that exact letter, not the next result matching the regex.
  2. Cmd + Shift + G and alternatives (alt/right shift/ctrl), Cmd + G selects the next result matching the Regex, which is in the right direction.
  3. 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.
  4. Lots of Googling and reading though Atom discussions.
  5. 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屋!

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