Notepad++ newline in regex

PaN1C_Showt1Me picture PaN1C_Showt1Me · Dec 9, 2010 · Viewed 97.9k times · Source

Suppose you have this file:

x
a
b
c
x
x
a
b
c
x
x

and you want to find the sequence abc (and select the whole 3 lines) with Notepad++ . How to express the newline in regex, please?

Answer

Robb picture Robb · Dec 9, 2010

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