Find:
^[#;].*
Replace with nothing. The ^
indicates the start of a line, the [#;]
is a character class to match either #
or ;
, and .*
matches anything else in the line.
In versions of Notepad++ before 6.0, you won't be able to actually remove the lines due to a limitation in its regex engine; the replacement results in blank lines for each line matched. In other words, this:
# foo
; bar
statement;
Will turn into:
statement;
However, the replacement will work in Notepad++ 6.0 if you add
,
or
to the end of the pattern, depending on which line ending your file is using, resulting in:
statement;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…