How to remove the last character on every line in Notepad++

notepad

In NotePad++ how do I turn this:

GingeredRovinsky7|NTDc4MAODY3Mg|

into this:

GingeredRovinsky7=NTDc4MAODY3Mg

I know I can do a find and replace and replace the first | with =

However I need to strip the last | from each line as well.

How do I do this?

Best Answer

If every line is going to consist of exactly two | characters in that format, I should think this regex find-and-replace will do it.

Find all:

^([^|]*)\|([^|]*)\|$

Replace all with:

\1=\2

Related Question