Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notepad++ regex -> newLine

I use Notepad++ and I need to delete all lines starting with, say "abc".

Attention, I don't need to replace the line starting with "abc" with a empty line, but I need to completely delete these lines.

How do I proceed (using regex, I suppose)?

like image 960
serhio Avatar asked Mar 04 '13 13:03

serhio


1 Answers

Try replace

^abc.*(\r?\n)?

with

nothing

The ^ indicates the start of a line.

The . means wild-card.

The .* means zero or more wild-cards.

x? means x is optional.

The \r?\n covers both \r\n (generally Windows) and \n (generally Unix), but must be optional to cover the last line.

like image 177
Bernhard Barker Avatar answered Sep 23 '22 00:09

Bernhard Barker