text search with regular expression – escape pipe character

I have data in big text file which is like


I want remove from "_abc" to first pipe character. I am using _abc.+\| with regular expression but it is selecting till last pipe character, where i want to select only till first pipe character.


How can i select only from _abc to first pipe character.

>Solution :

Here is my recommendation:


This will select everything between "_abc" and the first pipe.

If you need the first pipe incl:


You can test it by your own here:

Leave a Reply