in reply to string processing and regexp alternation...

The number of positional variables is determinative. In your example, there are three sets of parens, so there are three vars. If the expression was:

'((b)li(n)d|mi(c)e)'

There would be four. (Sorry, I know you know this :) But if the alternation left out the 'unused' parens there could be two or three vars. So you'd have to start doing some other checking before moving on, or you wouldn't know which parens the vars came from. And hey, you can always grep {defined;}.