I want to make a small Molecular Weight calculator. If the user for instance enters the molecular formula for dichloro-benzoic acid as "C6H3Cl2COOH", I would like to split it into a list like so I can then combine all the carbons, chlorines, oxygens and hydrogens and go on to the calculation.
Any good ideas how to do the splitting?