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

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

问题描述

我正在尝试选择一个正则表达式查找到的所有结果,以便我可以全部修改(不要将它们替换为文本!),例如,将所有结果都大写为.我知道我可以通过重复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/向右移位/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天全站免登陆