The overall goal is to solve a simple linear [one var] equation in the same way that a human would. So, finding the most nested (), distributing until all the multiplication is done. (then combining like terms and then dividing one side of x's to the other side of constants)
I'm trying to find the order of operations in a Python equation. For instance, in something like
3(18(7x-3)+x) = 90
I would want to find the most nested set of () [in this case is 7x-3] and work out from there. I'm not sure if RegEx would be the best way to do this in Python. Furthermore, I'm using SymPy, so in several cases, when I find the most nested () there will not be anything to solve because the first step is only multiplication anyways.