Notepad++ Regular expression find and delete a line

notepad++, regex

Solution

Step 1

- `Search` → `Find` → (goto Tab) `Mark`

- `Find what`: ^Session.*$

- Enable the checkbox `Bookmark line`

- Enable the checkbox `Regular expression` (under `Search Mode`)

- Click `Mark All` (this will find the regex and highlights all the lines and bookmark them)

Step 2

- `Search` → `Bookmark` → `Remove Bookmarked Lines`

Problem

I am trying to find and delete a line using Notepad++ I need to find lines in this file (UNIX Format) that match the string `'`#RedirectMatch Permanent`'` and delete that line. Does anyone know how to do this using Notepad++ Find and Replace? Thanks and Kind Regards,

Original source