Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: Regexps for Parsing Brackets in Chemical Formulae

by stefp (Vicar)
on Nov 04, 2001 at 08:12 UTC ( [id://123130]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    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;
    
  2. or download this
    C    3
    H   19
    ...
    N    1
    O    1
    P    4
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-16 16:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found