It's like the solution is right in front of me, but I just can't seem to see it.
var expr = "-5+6.3x24";
console.log(expr.split(/([+\-x\/])/));
The expected output should be:
["-5", "+", "6.3", "x", "24"]
I want to split the string using the separators +, -, x, /, but not when they are at the beginning of the string. Any suggestions on how to modify this code? Thank you very much.