I was trying to split a string based on multiple delimiters by referring How split a string in jquery with multiple strings as separator
Since multiple delimiters I
The following would be an easier way of accomplishing the same thing.
var tokens = x.split(new RegExp('[-+()*/:? ]', 'g'));
Note that - must come first (or be escaped), otherwise it will think it is the range operator (e.g. a-z)
-
range
a-z