title: Split string and separate value & unit
body: <p>I need to check if a string has the format: <code>1234g</code>, <code>1234 g</code>, <code>1.234kg</code> or <code>1.234 kg</code>
  That means there is a number value and after that the unit "g" or "kg" with or without space between them.</p>
  
  <p>Don't know how to add the unit in the regEx:</p>
  
  <pre><code>string.match(/^[0-9]+$/)
  </code></pre>
  
  <p>After the check I need to split the string to get just the numeric value. How do I do that?</p>