質問

I want to delete all lines ending with |

I tried

.*[|;]

but it's not the end

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top