I have these line of strings:
#input:
"A & B/C,1,2"
"\"D, E & F\",1,2"
which I would like to convert into arrays.
#output:
["A & B/C",1,2]
["D, E & F",1,2]
split(",")
is not suitable for this, so I tried regex:
str.split(",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)")
str.split(",(?=([^\"]*\"[^\"]*\")*[^\"]*$)")
both of these produces extra quote on the output:
["A & B/C,1,2"]
["\"D, E & F\",1,2"]
Can you please point out the wrong in the regex?