I have a javascript-string which contains semicolons (some of them are escaped).
My problem is, how do I split this string on all unescaped semicolons and leave the escaped ones
var example = "abc;def;ghi\;jk"
This should get:
example[0] = "abc";
example[1] = "def";
example[2] = "ghi\;jk";
I only found a PHP-regex, which is not working in javascript 🙁
'/(?<!\\\);/'
any ideas how to do this?
JavaScript has no negative look-behind (which would make this problem simple), so we can emulate it by reversing the string and using negative look-ahead!