Help for this page
use strict; my %count; ... s/([A-Z](?:[a-z])?)(\d*)/ $count{$1} += $2 ? $2 : 1 ;''/eg; printf "%-2s %3d\n", $_, $count{$_} for sort keys %count;
C 3 H 19 ... N 1 O 1 P 4