title: How to use regex for currency
body: <p>I need to grab a price from one element and add it to another.</p>
  
  <p>I am using this:</p>
  
  <pre><code>\$\d+(?:\.\d+)?
  </code></pre>
  
  <p>Which seems to work for <code>$0.50</code>, <code>$1.00</code>, <code>$20.00</code>, <code>$200.00</code> but I hit a brick wall on <code>$1,000.00</code> and $10,000.00</p>
  
  <p>(Unlikely <code>$10,000.00</code> will ever be used).</p>
  
  <p>The comma is tripping me up.</p>
  
  <p>** Edit **</p>
  
  <p>I went away for an hour to come back to heaps of answers. Before I go through them I thought I'd clarify rather than answering all comments:</p>
  
  <p>The platform being used auto generates the total value of items in a shopping cart. It gets rendered in a an element - this changes depending on whether a user is adding or removing items.</p>
  
  <p>The value is unlikely to go into 10,000.00 because the product costs are not that high.</p>
  
  <p>I am new to using the regex it took me long enough to get this far, hence the question.</p>
  
  <p>Auto generated HTML:</p>
  
  <pre><code>&lt;span vertical="False" quote="False" id="catCartSummary"&gt;
     &lt;table cellspacing="0" class="cartSummaryTable"&gt;
       &lt;tbody&gt;
         &lt;tr&gt;
           &lt;td class="cartSummaryItem"&gt;3 item(s), Total: $115.00 &lt;a href="#" class="cartSummaryLink"&gt;View Cart&lt;/a&gt;&lt;/td&gt;
         &lt;/tr&gt;
       &lt;/tbody&gt;
     &lt;/table&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>I just need the $ value in this case $115.00 - But I need it to work for $1,000.00</p>