I have a string that, from a file_get_contents() call, contains something like:
<span class="cb_price_countdown cb_lot_price_1439066">$40.65</span>
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:
$pattern = "/\\\$?((\d{1,3}(,\d{3})*)|(\d+))(\.\d{2})?$/";
preg_match ($pattern, $subject, $matches);
print_r ($matches);
Which is not returning anything useful, and I've tried:
$pattern = "/[\d+|\d+,\d+]\.\d{0,2}/";
but it's the same story. Can somebody please tell me the correct preg_match pattern that I'm looking for?
Thank you,
Justin