문제

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