in reply to Re: Re: Re: Regexps for Parsing Brackets in Chemical Formulae
in thread Regexps for Parsing Brackets in Chemical Formulae
Muchas gracias - one minor alteration to take account of the fact that certain artificial elements have, under certain nomenclatures, three letters rather than one or two...
s/([A-Z](?:[a-z]{0,2})?)(\d*)/ $count{$1} += $2 ? $2 : 1 ;''/eg;
Otherwise, perfect!
Ta, Elgon.
"Without evil there can be no good, so it must be good to be evil sometimes.
--Satan, South Park: Bigger, Longer, Uncut.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Re: Regexps for Parsing Brackets in Chemical Formulae
by stefp (Vicar) on Nov 07, 2001 at 22:27 UTC |