Javascript – lookbehind alternative way
This code doesn't work in safari 15, so need another way to solve it without lookbehind const re = /(?<!\)(?<!-)-/g; const str = '20-30--40\---50--60'; console.log(str.split(re)); output: ['20', '30', '-40\---50', '-60'] What this code does: Need to split the string into…