my @strings = qw( aaabbbb ab abb aabb aaabb aabbb ); for my $string ( @strings ) { my $a_counter = $string =~ tr/a/a/; my $b_counter = $string =~ tr/b/b/; print "In $string there were $a_counter 'a's and $b_counter 'b's. +\n"; }
In reply to Re: Extracting the number of repetitions from a regex
by mr_mischief
in thread Extracting the number of repetitions from a regex
by pat_mc
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |