Notepad++ regex -> newLine
13,600
Solution 1
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.
Solution 2
Search for this regular expression
^abc.*\r\n
Replace with nothing.
Author by
serhio
I like .NET and started learning PHP. email: gserhio[at]gmail[.]com
Updated on June 11, 2022Comments
-
serhio almost 2 years
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)?
-
Neozaru about 11 yearsYes. And << (^|\r?\n)abc.*\r?\n >> for "abc...<something else>"
-
ellak about 11 yearsThis would match lines with abc in the middle also.
-
Mohammad Dehghan about 11 yearsDoes not work for last line of the file, when the file has no new line at the end.
-
Mohammad Dehghan about 11 yearsDoes not work for last line of the file, when the file has no new line at the end.