Assuming that there are no commas in your data other than those separating the params, I would split the lines on /\s*,\s*/, which would give you an array of your parameters, then loop through the parameters and match each of them. ie (warning, untested code)
while (<>) {
my @params = split /\s*,\s*/;
foreach my $param (@params) {
$param =~ /(Identities|Positives|Negatives)\s+=\s+(.+)\s+\((.+)\%\
+)/;
# $1 now contains which type you matched, $2 and $3 are the submat
+ches, do what you will with them
}
}
or you could get fancier and do:
while (<>) {
my %params = map {
my ($k,$v) = split /\s*=\s*/;
$v =~ /(.+)\s+\((.+)\%\)/;
($k => [$1,$2])
} split /\s,\s*/;
}
and get a hash of all your params in one fell swoop.
-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."