A program that accepts a mathematic expression that can include addition, subtraction, multiplication, division, powers ^, sin(x), cos(x), tan(x), - sign, and any number of brackets. Such as: sin(2*(-5+1.54)+28) tan(2025 ^ 0.5) 1+(1+(1+1)(1+1))(1+1)+1 2(589+((24540.1548/0.01(-2+9^2))+((25123.12+4587725)+25))-547) -(-2^(-2))+2+(-(-2^(-2)))
The task is solved recursively, with regular expressions, Pattern and Matcher classes.