kapila has asked for the wisdom of the Perl Monks concerning the following question:
I need to match a pattern something like this
$var="FILES CHECKED IN: TEST 1.3 5.4 S.txt 1.93 1.2 + ";chomp($var); my $pattern='FILES CHECKED IN:[\s]+(.*?)\s+(\d+\.\d+(\.*\d*)*)\s+(\d+\ +.\d+(\.*\d*)*|NONE)*';chomp($pattern); if ("$var" =~ m{$pattern}) { print "MATCH==$1==$2==$4==$6==$7==$8==$9 \n"; } else { print "NO=$1\n " ; }
output- MATCH==TEST==1.3==5.4========
This only matches the last pattern, i want it to match as many times its present. i.e means match repeatedly..can anyone help me in this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Repeated Pattern Matching Fails
by ELISHEVA (Prior) on Apr 14, 2009 at 10:35 UTC | |
by kapila (Acolyte) on Apr 14, 2009 at 11:40 UTC | |
by shmem (Chancellor) on Apr 14, 2009 at 12:11 UTC | |
by kapila (Acolyte) on Apr 15, 2009 at 08:51 UTC | |
by parv (Parson) on Apr 15, 2009 at 10:10 UTC | |
|
Re: Repeated Pattern Matching Fails
by targetsmart (Curate) on Apr 14, 2009 at 08:17 UTC | |
by kapila (Acolyte) on Apr 14, 2009 at 09:34 UTC | |
|
Re: Repeated Pattern Matching Fails
by parv (Parson) on Apr 14, 2009 at 10:12 UTC |