You might be looking for $+. Quoting the docs:
The text matched by the last bracket of the last successful search pattern. This is useful if you don't know which one of a set of alternative patterns matched. For example:
/Version: (.*)|Revision: (.*)/ && ($rev = $+);
In reply to Re: RegExp, grabbing first name
by Anonymous Monk
in thread RegExp, grabbing first name
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |