This way you can access any percentage by name.use strict; use warnings; my ($text, %percent); $text = 'Identities = 1529/1540 (99%), Gaps = 2/1540 (0%)'; $percent{$1} = $2 while $text =~ /(\w+) = \d+\/\d+ \((\d+)%\)/g; for (sort keys %percent) { print "$_ : $percent{$_}\n"; }
In reply to Re: Regular expression question
by TedPride
in thread Regular expression question
by PERLarity
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |