And just for the record:
>perl -wMstrict -le "print pop @{[ 'hello awesome' =~ /(el).*(om)/ ]}; " om
Update: And with 5.10 regex one can also do:
>perl -wMstrict -le "'hello awesome' =~ /(?<m>el).*(?<m>om)/; print $-{m}[-1]; " om
In reply to Re^2: accessing the result of a match as an array
by AnomalousMonk
in thread accessing the result of a match as an array
by intuited
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |