Notepad ++ Regular expression finds and deletes a string

I am trying to find and delete a string using Notepad ++

I need to find the lines in this file (UNIX Format) that match the line ' #RedirectMatch Permanent ' and delete this line.

Does anyone know how to do this using Notepad ++ Find and Replace?

Thanks and respect,

+43
regex notepad ++
04 Sep '09 at 2:30
source share
5 answers

Step 1

  • SearchFind → (goto Tab) Mark
  • Find what : ^ Session. * $
  • Check Bookmark line
  • Check the Regular expression box (under Search Mode )
  • Click Mark All (this will find the regex and select all the lines and mark them)

Step 2

  • SearchBookmarkRemove Bookmarked Lines
+58
May 24 '12 at 5:41
source share

If it supports standard regex ...

 find: ^.*#RedirectMatch Permanent.*$ replace: 

Replace nothing.

+29
Sep 04 '09 at 2:34
source share

In the search dialog box, specify the following:

Find what: ^$\r\n
Replace with: (leave it blank)

Click Replace All

+13
Apr 03 '13 at
source share

Using the Replace All function, you can delete a line directly with , ending your template with :

  • If the linux (LF) line is completed in your file: $\n?
  • If your file has a window string (CRLF): $(\r\n)?

For example, in your case:

 .*#RedirectMatch Permanent.*$\n? 
+2
Feb 09 '16 at 13:43
source share

Combination of the best of all answers

enter image description here

0
Sep 11 '17 at 12:51 on
source share



All Articles