in reply to Re: accessing the result of a match as an array
in thread accessing the result of a match as an array
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: accessing the result of a match as an array
by JadeNB (Chaplain) on Dec 24, 2009 at 23:04 UTC | |
by AnomalousMonk (Archbishop) on Dec 24, 2009 at 23:21 UTC |
In Section
Seekers of Perl Wisdom