Regular expression for pipe delimited and double quoted string

Posted by Hiren Amin on Stack Overflow See other posts from Stack Overflow or by Hiren Amin
Published on 2014-05-30T14:44:43Z Indexed on 2014/05/30 15:27 UTC
Read the original article Hit count: 256

Filed under:
|

I have a string something like this:

"2014-01-23 09:13:45|\"10002112|TR0859657|25-DEC-2013>0000000000000001\"|10002112"

I would like to split by pipe apart from anything wrapped in double quotes so I have something like (similar to how csv is done):

[0] => 2014-01-23 09:13:45
[1] => 10002112|TR0859657|25-DEC-2013>0000000000000001
[2] => 10002112

I would like to know if there is a regular expression that can do this?

© Stack Overflow or respective owner

Related posts about c#

Related posts about regex