I need a regular expression that will match 0-9, (,),+,-,* and /.
0
9
(
)
+
-
*
/
This works for mathematical expression with 4 decimal places:
^([-+]? ?(\d+(\.\d{0,4})?|\(\g<1>\))( ?[-+*\/] ?\g<1>)?)$
It's inspired in base of @ndnenkov answer.
I hope that can be useful for someone.