in reply to Re: Length of first captured match
in thread Length of first captured match

While I think this is what you're looking for, I'm just guessing at what the right answer is if there is no match.
Actually, there will always be a match, but it's appropriate to worry about null matches.

-QM
--
Quantum Mechanics: The dreams stuff is made of