You know that math expressions may have many parentheses '(' and ')' and there are parentheses in other parentheses:
I want to get all matches that start with '(' and finish with the corresponding ')'.
In the above example the match should be from 1 to 0.
Is there a regular expression -in PHP- that can do this?
Code:
...(...(...(...)...(...)...(...(...(...)...)...(...)...)...)...)...
[COLOR=Red]1[/COLOR] 2 3 2 3 2 3 4 5 4 3 4 3 2 1 [COLOR=Red]0[/COLOR]
In the above example the match should be from 1 to 0.
Is there a regular expression -in PHP- that can do this?
Last edited:








