The following validated JavaScript function does the trick:
Seasonal semicolons:
function splitByUnescapedSemicolons(text) { var a = [];
This solution correctly processes escape semicolons (and avoids anything else, including escape-escape files).
Sample data:
"" == []; ";" == ['', '']; "\;" == ['\;']; "\\;" == ['\\', '']; "one;two" == ['one', 'two']; "abc;def;ghi\;jk" == ['abc', 'def', 'ghi\;jk']; "abc;def;ghi\\;jk" == ['abc', 'def', 'ghi\\', 'jk'];
source share