in reply to Re: Array Filter and Lookahead
in thread Array Filter and Lookahead
>perl -wMstrict -le "my @test = ('0 xx', 'xx 0', '0'); ;; my @test_filtered = map { (/(\d+)[\d.]*/g)[-1] || '' } @test; printf qq{'$_' } for @test_filtered; " '' '' ''
Update: // vice || does the trick.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Array Filter and Lookahead
by Kenosis (Priest) on Nov 20, 2012 at 20:29 UTC | |
by AnomalousMonk (Archbishop) on Nov 20, 2012 at 21:18 UTC | |
by Kenosis (Priest) on Nov 20, 2012 at 21:31 UTC |