in reply to Refer by relative way to regex group (eg. the last one)
You may wanna try the two possibilities listed in perlretut and perlvar
You got those links already last time you asked.
Additionally has perlre even a demo similar to your code.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In Section
Seekers of Perl Wisdom