in reply to Re^2: When the only tool you have is a screwdriver...
in thread When the only tool you have is a screwdriver...

Yes, but your situation is not necessarily “balanced.”   In the left/right parenthesis example, once the right-paren is seen, the matter is resolved.   But in some of your examples, we see multiple occurrences of "e".   Thus, in the general case, more-than-one recursion might have to be entered, and then backed-out in what turns out to be a failed parse-branch.   I do not believe that you can expect the regex engine to be that smart, although other Monks may promptly jump-in and show that I am wrong.

However ... the saving grace might be “your actual data.”   If, for example, the terminal-tokens always consist of single characters, some sort of one- or one-and-three- character lookahead might be sufficient to resolve ambiguity.   After all, you do not always have to write for the general case:   you merely have to write what gets the job done in your case.   (Yay!)

Even so, I think that this requirement (IMHO) has stepped beyond what you can reasonably expect from regular-expressions alone:   it is, I think, “a parsing problem.”   (By that I mean, “some sort of heuristic will be required, on top of what regexes alone can give you.)   With good fortune, you will find that there is an existing implementation of a heuristic (a parser) that will do the job.   Without good fortune, you will hack.   ;-)