I have a string from a csv file which I want to split. The string may contain a comma within a double quote or within a JSON. For example if the string is:
abc, pq"r,s", {"one":1, "two":2}
The regex should split it into three tokens as:
abc
pq"r,s"
{"one":1, "two":2}
I have tried this regex.
The regex reads like this: (?x)[,](?=([^"]*"[^"]*")*[^"]*$)
Can anyone please suggest a right regex?