Remove characters with regex in c#

Posted by Rise_against on Stack Overflow See other posts from Stack Overflow or by Rise_against
Published on 2011-01-11T13:48:30Z Indexed on 2011/01/11 13:53 UTC
Read the original article Hit count: 442

Filed under:
|

Hello all,

I am not a regex specialist, so I need some help with this. I have a text file, and I need to remove some trailing delimiters. The text file looks like this:

MSH|^~\&|OAZIS||||20101029135359||ADT^A31|00000015|P|2.3.1||||||ASCII
EVN|A31|20101029135359^^^^||||19900101

So I think the best way is to do a Regex replace? Can anyone help me with this regex?

I want to remove all ^ that come before a |

So test^A^^| has to become test^A|

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about regex