You can match a regex like this:
One or more digits (also allowing a decimal)
followed by optional whitespace
followed by an operator
followed by optional whitespace
followed by one or more digits (also allowing a decimal)
and then reference the captured group in the middle to get just the operator:
/[\d.]+\s*([*+\-\/])\s*[\d.]+/
Sample code:
var match = str.match(/[\d.]+\s*([*+\-\/])\s*[\d.]+/);
if (match) {
var operator = match[1];
}
Working demo and test code: http://jsfiddle.net/jfriend00/DgrSg/
If you want to allow more than just digits before the operators (such as other expressions), then you will have to do a lot more than a simple or even complex regex. This answer assumes you're just trying to solve the examples that you've presented.
5--5.