title: How to Find Character After some Specific String? [Chemistry Code]
body: <p>I'm trying to write a code where I enter a molecule (only using those that include C, H, O, Cl and N for convenience) for input and get the molecular weight.</p>
  
  <p>Like if I enter <code>C2H4</code>, it should do the calculation:</p>
  
  <pre><code>MW = mass_C * 2 + mass_H *4
  </code></pre>
  
  <p>I need the code to take the letter(s) before the number, then multiply it with the number following the "string" until it reaches the end.</p>
  
  <p>So basically, how do I get the letters before a number?</p>
  
  <p>PS: I'm new to coding :) so would be nice to see written code instead of just explanation to understand the format I should use for RE's.</p>