Domanda

I want to delete all lines ending with |

I tried

.*[|;]

but it's not the end

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top