

The first set of parentheses may be accessed with 1 and the second set with 2.

Switch to Regular Expression search mode. rnrn finds two newline characters (what you get from pressing Enter twice).rn is a newline character (in Windows).Press Replace All and all the blank lines will be removed. Switch to Extended search mode in the Replace dialog. Open the Search & Replace dialog box (Ctrl+H) and select the Regular Expression search mode. Select your desired search mode.Įxample 1: For this example let’s remove all lines that begin with a certain character, for example the exclamation point. In the Find (Ctrl+F) and Replace (Ctrl+H) dialogs, the three available search modes are specified in the bottom left corner. Together, Extended and Regular Expression search modes give you the power to search, replace and reorder your text in ways that were not previously possible in Notepad++. Now, we can use Extended search mode to make up for this shortcoming. One of the major disadvantages of using regular expressions in Notepad++ was that it did not handle the newline character well - especially in Replace. These slides by Anjesh Tuladhar on regular expressions in Notepad++ is very useful. Unfortunately, the Notepad++ documentation is lacking in its description of these new capabilities. It now has a new Extended search mode that allows you to search for tabs(t), newline(rn), and a character by its value (o, x, b, d, t, n, r and \). Since the release of version 4.9, the Notepad++ Find and Replace commands have been updated. Notepad++ is an excellent text editor and replacement to Microsoft’s notepad.exe.

The information in this post will benefit anyone looking to understand how to use Notepad++ extended search mode and regular expressions.
