I have a string where I need to separate it by +-*/ and put it into array.
I've tried this code that I also found here, but it doesn't seem to be working. It gives me the error "Invalid regular expression: /+|-|*|//: Nothing to repeat."
var separators = ['+', '-', '*', '/'];
var numbers = x.split(new RegExp(separators.join('|'), ''));
Any advice on how should I do this?