I need to get a piece of data out of an array elemet using a regex but cant seem to get the syntax right.
Now the data in the array elements is as follows
33.3 kb/s (6.5%)
I am trying to grab the 6.5% on each element. Note the numerical data within the parathesies changes but holds the same format. I have tested the regex and I think it is correct but I am not getting the data.
thanks
haunter@battlestrata.com
Now the data in the array elements is as follows
33.3 kb/s (6.5%)
I am trying to grab the 6.5% on each element. Note the numerical data within the parathesies changes but holds the same format. I have tested the regex and I think it is correct but I am not getting the data.
Code:
my @ary1 = split /,/;
for (my $i = 3; $i < @ary1; $i++){
#print $ary1[$i].'0\n';
my $tt= $ary1[$i] =~ m!\({1}\d*\.\d*%\){1}!;
print $tt . '\n';
print $1;
}
thanks
haunter@battlestrata.com