Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: How to avoid an alphabet and integer next to it in a string?

by piscean (Acolyte)
on Mar 21, 2014 at 18:02 UTC ( #1079315=note: print w/ replies, xml ) Need Help??


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");
  • Comment on Re^3: How to avoid an alphabet and integer next to it in a string?
  • Download Code

Replies are listed 'Best First'.
Re^4: How to avoid an alphabet and integer next to it in a string?
by runrig (Abbot) on Mar 21, 2014 at 18:08 UTC
    $molform =~ s/[^a-zA-G0-9]//g;

    Just eliminate the Hydrogen:

    $molform =~ s/H\d*//g;
      It says Forbidden chars. No output at all!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1079315]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2016-06-25 08:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (323 votes). Check out past polls.