Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to have some grep-like functionality in Notepad++.

In it simplest version, I would like to be able to copy all lines from the current buffer that contain the word foo to a new buffer. I can use the TextFX plugin to hide all lines without foo, but that doesn't do all that I want (it's lost on Alt - Tab, I can't copy only the matching lines, etc.).

share|improve this question
up vote 50 down vote accepted

Ctrl+F --> go to the Mark tab --> toggle Bookmark line --> Click Mark All.

Select menu Search --> Bookmark --> Copy Bookmarked Lines.

share|improve this answer
Nice, thanks. You can 'cut bookmarked lines' for a poor man's grep -v too. – ARRG Jul 15 '13 at 15:02
In later versions, e.g. 5.4.5, there isn't any "Mark" tab. Instead, there is a checkbox, "Mark Line", in the "Find" tab. And "Copy Bookmarded Lines" is direcly in the "Search" menu. – Peter Mortensen May 4 '14 at 22:23
@ARRG Can't find the cut bookmarked lines or Copy bookmarked lines in current version, where is it ? – Nicolas Thery Feb 2 at 9:11

I was just looking into this same question. I am not sure if you're aware; in the Find dialog, you can Find All in Current Document which will pop up a window at the bottom showing the matching lines. Then you can copy that into a new document.

Unfortunately, it includes some extraneous information in the results (line number, etc.), but you can filter that out using column mode.

share|improve this answer
The added line numbers might even be a feature :) – Frank Meulenaar Apr 14 '12 at 7:37
You might find this plugin useful – Amarghosh Oct 5 '12 at 14:14
@Amarghosh Nice plugin, but lacks a bit of ergonomy (why buttons and no keyboard shortcuts ?). Nice catch :) – Benj Apr 5 '13 at 11:58
@Benji Alt-Q will launch the plugin. Even though there are no shortcut keys within plugin window, basic tab navigation has been enabled. If there is enough interest in the plugin, I will try to add more features as I get some time. Thanks for the feedback :) – Amarghosh Apr 6 '13 at 13:42
@Amarghosh Very nice plugin, thank you!!! – lucaferrario Dec 4 '14 at 17:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.