Split equation and retain numbers and operators. Possible?
Is there a regular expression that will split a string between operands like +, -, * or /
similar to the following attempt that only partially works?
Both give the same results. They split on the numbers, but loses the operators.
var strIn = '123+456-321';
var tarrN = strIn.split(/\D/);
var tarrO = strIn.split(/\+|\-|\*|\//);
I was trying for an output of: