Notepad++ regex -> newLine

前端 未结 5 1768
孤街浪徒
孤街浪徒 2021-01-06 03:02

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

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-06 03:37

    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.

提交回复
热议问题