I was wondering if it was possible to use regex to solve simple mathematical expressions with real numbers, and the operators +, -, *, / and ^.
For example the input would be a string like '3.5+4^2' (this could also be written as '+3.5+4^2') and the output 19.5. My idea was to have regex first recognise ^ as the procedure to perform first. So he would take 4^2 and return 16 so the expression would be '3.5+16'. Then it would recognise + and return 19.5.
Another input example would be -4+5.5*4/2 --> -4+22/2 --> -4+11 --> 7