title: Extracting a price using preg_match in PHP
body: <p>I have a string that, from a file_get_contents() call, contains something like:</p>
  
  <pre><code>    &lt;span class="cb_price_countdown cb_lot_price_1439066"&gt;$40.65&lt;/span&gt;
  </code></pre>
  
  <p>And I would like the extract the price 40.65.  I am not familiar with regex or preg_match so I'm having a hard time.  So far I have tried:</p>
  
  <pre><code>    $pattern = "/\\\$?((\d{1,3}(,\d{3})*)|(\d+))(\.\d{2})?$/";
      preg_match ($pattern, $subject, $matches);
      print_r ($matches);
  </code></pre>
  
  <p>Which is not returning anything useful, and I've tried:</p>
  
  <pre><code>    $pattern = "/[\d+|\d+,\d+]\.\d{0,2}/";
  </code></pre>
  
  <p>but it's the same story.  Can somebody please tell me the correct preg_match pattern that I'm looking for?</p>
  
  <p>Thank you,<br>
  Justin</p>