title: Get CSS value as written in stylesheet with jQuery or RegEx
body: <p>I was looking at CSS3 <a href="https://developer.mozilla.org/en-US/docs/CSS/calc?redirectlocale=en-US&amp;redirectslug=CSS/-moz-calc" rel="nofollow">calc()</a> and I wondered whether it is possible to subtract a value from the input string with jQuery (or RegEx).</p>
  
  <p>For example:</p>
  
  <pre><code>div {
    width: calc(100% - 50px);
  }
  </code></pre>
  
  <p>I want to get the percentual value (<code>100%</code>) and the pixel value (<code>50px</code>) and I need to know what it is followed by (<code>px</code>, <code>em</code>, <code>pt</code>, <code>%</code>).</p>
  
  <p>So basically:</p>
  
  <ul>
  <li>get a value after <code>calc(</code> and before a seperator (<code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>)</li>
  <li>get a value after the seperator and before <code>)</code></li>
  <li>note that there could be more values than one!, e.g. <code>calc(100% - 20px - 0.8em)</code></li>
  </ul>
  
  <p><strong>EDIT:</strong> 
  Spudley talks of parsing the whole CSS stylesheet, but this might cause overhead. Because this a project <em>for the heck of it</em>, overhead is <strong>allowed</strong>, so you can go haywire and do whatever you want to accomplish this!</p>
  
  <p>Thanks.</p>