Sublime Forum

Work with lines


Hello everyone!

I have file with large list of phrases with keywords. Each phrase is on a separate line. I need to cut all lines that contains phrases with specific keyword and paste them into another empty file. Thus I want to group all the phrases by keywords.

Tell me please can Sublime Text find all lines that contain speific word or phrase and then cut them and paste into mpty file?

Thanks a lot in advance



Easy with the ‘Find all’ option of the ‘Find’ feature (with regexp enabled).

If, for example, you want all lines with ‘disable’, search for ‘^.disable.$’, and then press ‘Find all’, copy and finally past in a new document.



Thanks a lot!

Сan you tell me how to create a regular expression for the search lines with specific keyword if this keyword can be in different places of lines? For example I need to cut lines with keyword “mac” and lines containing this keyword look like this:

  • buy mac

  • mac os mojave

  • buy used mac alibaba

The regular expression that you wrote does not find such lines



Personally, I do such things with multiple crtl+d (or alternatively with ‘select all’) on selected “mac” and then to crtl+k (delete line) remove all matched lines (or do smth different). Maybe this helps you on some cases.




At the end I found out how to to this!

  • Switch on the use of regular expressions
  • In search line write expressions: .*{search word}.*
  • Press “Find All” button
  • Copy results
  • Paste them into new page

That’s all! It’s awesome! Hope, it will be useful for forum visitors.