I need to parse csv file using JavaScript. Parsing comma separated string could be easy in case if the values do not contain commas themselves just by using str.split(','). But how it can be done if the string is the following:
12.0,trs,"xx-xx NY,US"
or sometimes there are quotes or double quotes on all values:
"12.0","trs","xx-xx NY,US"
but sometimes there are also additional space after the comma:
"12.0","trs", "xx-xx NY,US"
I guess I need to use regular expression, but I could not find universal one, that cover all cases. Please help!