in reply to Regular expressions and metacharacters
my @filedata = ( '24..4 foo bar', '12..13 13..14 14..15 15..1 15..2 14 +..3 13..16 16..4 16..17 17..5 17..18 18..6 18..7 12..19 19..20 20..8 +20..10 19..9 12..11', 'junk'); my @result; for my $line (@filedata){ if($line =~ m/^ (?: \s* \d+ \. \. \d+ \s* )+ $/x ){ @result = split ' ', $line; last; } } print join ', ', @result;
|
|---|