I have a equation I get in a file something like (((2+1)*(4+5))/2)
. What I am looking for is the distinct mathematical expressions inside it.
In this case:
2+1
4+5
(2+1)*(4+5)
and finally ((2+1)*(4+5))/2
.
I started by lookins at these How can I split a string of a mathematical expressions in python? But not able to arrive at a solution..
Can you please help.