I tried and stuck to this formula which only only work on 1 pair of brackets:
preg_match('#\((.*?)\)#', $text, $match);
print $match[1];
What I want to do is parse the text after the last open parenthesis before the first close parenthesis.
For example, I have equation like this:
1+(2+(3+(5-6)))+(7-8)
The text that would be parsed is "5-6".