The string I am trying to split:
string1, string2, string\,3, string4
I want to split the above string on each comma, except when the comma is escaped with a backslash.
I am unable to utilize negative lookbehind in my JavaScript.
My attempt:
var splits = "string1, string2, string\,3, string4".split("(?<!\\\\),");
None of the commas are being recognized.
Potential solutions: after research, I stumbled across this SO question. However, I don't understand the workarounds well enough to change the above code to the replace the use case.