I'm trying to split a String in JavaScript that is separated by commas but, I have extra commas within the portions of the string I want to keep together. Here's an example:
var str = 'A. This is one part, B. This is the, tricky part., C. Final portion';
My desired result is an array like this one:
var arrayAfterSplit = [
'A. This is one part',
'B. This is the, tricky part',
'C. Final portion'
];
I'm trying with Regex but, no success until now, I'd appreciate any help guys. Thanks.