added input type checking for the two operands and the operator using regex