Faxsy
Faxsy

Reputation: 361

Notepad++ delete lines ending with specific character

I want to delete all lines ending with |

I tried

.*[|;]

but it's not the end

Upvotes: 2

Views: 8941

Answers (1)

senshin
senshin

Reputation: 10360

Use the following regex:

.*\|$

This says "any character any number of times (.*), followed by a pipe (\| - you have to escape it), and then the end of a line ($)".

If you want to find lines ending with either ; or |, use:

.*[\|;]$

You don't have to escape the pipe in this case, but I prefer to do so anyway.

In either case, make sure you're in "Regular expression" search mode with ". matches newline" unchecked.

Upvotes: 6

Related Questions