删除所有文本但在 SublimeText 中匹配 [英] Delete all text but matches in SublimeText
本文介绍了删除所有文本但在 SublimeText 中匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试删除 sublime 中除电子邮件之外的所有字符串.
I am trying to delete all strings except emails in sublime.
所以我可以寻找这样的电子邮件
So i can look for emails like this
[a-zA-Z0-9.!#$%&'+-/=?\^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[\.a-zA-Z0-9-]+)
但是我如何删除其他所有内容?
But how do i delete everything else?
谢谢
推荐答案
您可以执行以下操作:
- 使用正则表达式查找所有电子邮件,点击查找全部以选择所有电子邮件
- 转到
Selection
并点击Invert Selection
- 按 Enter 在找到的电子邮件之间添加换行符.或者,按 、 或任何其他键插入任何内容以分隔找到的匹配项.
- Use your regex to find all emails, click Find All to select all emails
- Go to
Selection
and clickInvert Selection
- Press Enter to add line breaks between the found emails. Or, press , or any other key to insert anything to delimit found matches.
这篇关于删除所有文本但在 SublimeText 中匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文