Delete all text but matches in SublimeText

柔情痞子 提交于 2019-12-02 02:15:42

问题


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?

Thanks


回答1:


You may do the following:

  • Use your regex to find all emails, click Find All to select all emails
  • Go to Selection and click Invert Selection
  • Press Enter to add line breaks between the found emails. Or, press , or any other key to insert anything to delimit found matches.


来源:https://stackoverflow.com/questions/52450052/delete-all-text-but-matches-in-sublimetext

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!