M
Mirco Wahab
Hi Glorious Perlers
how would I find out the last matching
expression from my regular expression.
I remember to have heard about the
trick - but can't get it to work.
Example:
$r = qr/(alpha|beta|gamma) (?{'greek'})
|(aleph|beth|gimel) (?{'hebrew'})
|(DIbvetlh|nobta'|tlhIngan) (?{'klingon'})
/x;
$_ = qq/nobta' tlhIngan Hol yejHaD. ghIq qo'vaD/;
print "$^R: $^N (\$###)\n" while /$r/g;
Instead of (\$###) I'd expect to print
the matching capture group, -> "DIbvetlh|nobta'|tlhIngan"
in the above example.
Who can move me into the right direction?
Thanks
Mirco
how would I find out the last matching
expression from my regular expression.
I remember to have heard about the
trick - but can't get it to work.
Example:
$r = qr/(alpha|beta|gamma) (?{'greek'})
|(aleph|beth|gimel) (?{'hebrew'})
|(DIbvetlh|nobta'|tlhIngan) (?{'klingon'})
/x;
$_ = qq/nobta' tlhIngan Hol yejHaD. ghIq qo'vaD/;
print "$^R: $^N (\$###)\n" while /$r/g;
Instead of (\$###) I'd expect to print
the matching capture group, -> "DIbvetlh|nobta'|tlhIngan"
in the above example.
Who can move me into the right direction?
Thanks
Mirco