Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

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


in reply to Re: 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?

Yes, this is what I was looking for. Thanks! I tried avoiding H in C6H9. It turned out to calculate C69 giving me a wrong result. Of course, I was foolish enough to try this.
  • Comment on Re^2: How to avoid an alphabet and integer next to it in a string?

Replies are listed 'Best First'.
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
    my $molform = <STDIN>; $molform =~ s/[^a-zA-G0-9]//g; my $molmass = new Chemistry::MolecularMass; my $mass = $molmass->calc_mass("$molform");
      $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://1079314]
help
Chatterbox?
[Discipulus]: hi Tux and good morning you and all!
[Discipulus]: I read about stack size of the tk cb program: have you tried the MCE version? -mce on command line
[msh210]: wow... talk about overkill... seeking a Perl way to split a file by size while ending on a line ending, and only then discovered that split -C will do it

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2017-09-20 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (234 votes). Check out past polls.

    Notices?