Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

text search with regular expression – escape pipe character

I have data in big text file which is like

myimg1

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

myimg2

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

>Solution :

Here is my recommendation:

_abc\s*\|

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

If you need the first pipe incl:

_abc\s*\|[^|]*\|

You can test it by your own here:
Regex101

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading