Reason for doing this? As far as my regexp skills go (there are obviously people a lot more skilled than me), I'd say this is either not feasible with (one) regexp, or possibly feasible, but nowhere near worth the effort to right your essay-sized regexp.
For these examples, let $st be start tag (<a>) and $end be end tag (</a>)
Consider two strings
$s1 = '<a>abc</a><a>123</a>';
$s2 = '<a>abc<a>123</a>def</a>';
And two patterns
$p1 = "#$st.*$end#";
$p2 = "#$st.*?$end#";
The first pattern would get these
<a>abc</a><a>123</a>
<a>abc<a>123</a>def</a>
And the second pattern would get these
<a>abc</a>
<a>abc<a>123</a>
Now, looking at these two examples, you find that neither pattern is acceptable for all input strings for even capturing just the contents of your a element so that you can even begin to check for a nested b element in these captured strings.
Since you didn't specify restrictions on descendant and sibling elements, I assume there are no such restrictions, and that, as such, you can't simply choose one pattern. You'd have to use the greedy pattern, then keep checking the captured contents recursively to get strings belonging only to one a element, then do the same process on this/these for b element(s).
So, if you are not doing this just for practicing algorithm constructions (and very very basic regexp), or for practicing construction of superfreaky, large, unreable and annoying regexp patterns, I'd recommend not reinventing the wheel in square shape, but stick with the round shaped wheel that we allready have: DOM and XPath