in reply to Counting in regular expressions

Do you want separate counts of each, or just one big count?

Anyway, when you use the /g modifier with a pattern match, you can capture all of the matches into a list, eg:

my @digits = ($input =~ m/\d/g);
And then the count you are after is simply the number of items in the list:
print scalar @digits;
Rinse, lather, repeat, etc...

Hope this helps,
Darren :)