in reply to
Re^2: How to avoid an alphabet and integer next to it in a string?
in thread How to avoid an alphabet and integer next to it in a string?
my $molform = <STDIN>;
$molform =~ s/[^a-zA-G0-9]//g;
my $molmass = new Chemistry::MolecularMass;
my $mass = $molmass->calc_mass("$molform");
Just eliminate the Hydrogen:
$molform =~ s/H\d*//g;
By rote learning.
Via Genetic memory.
It's provided by my firmware.
I just remember them.
Thirty days hath September
My computer gets it right, usually.
I just ask someone else.
Someone punches me on the first of the month.
Results (24 votes),