Notepad++ newline in regex

Update 18th June 2012

With the new Notepad++ v6, you can indeed search for newlines with regexes. So you can just use

a\r\nb\r\nc

even with regular expressions to accomplish what you want. Note \r\n is Windows encoding of line-breaks. In Unix files, its just \n.

Unfortunately, you can't do that in Notepad++ when using regex search. Notepad++ is based on the Scintilla editor component, which doesn't handle newlines in regex.

You can use extended search for newline searching, but I don't think that will help you search for 3 lines.

More info here.

Update: Robb and StartClass0830 were right about extended search. It does work, but not when using regular expressions search.


Notepad++ can do that comfortably, you don't even need regexes

In the find dialogue box look in the bottom left and switch your search mode to Extended which allows \n etc.

As odds on you're working on a file in windows format you'll be looking for \r\n (carriage return, newline)

a\r\nb\r\nc

Will find the pattern over three lines