<root>
<td align="left"><a title="Testing" href="www.test.com/product/">$129.00</a></td><td valign="bottom">Testing</td></root>
How do I go about selecting the 129.00 in the above example? I don’t want the $.
Currently I have preg_match('/\$.{6}/') to select this. This is generally ok, but whenever it becomes a 4 digit string, it fails. Eg. $50.00
Thanks.
As many will tell you, don’t use regex to parse html/xml structures. But if you really want or have to use regex, try this pattern:
\$([0-9\.]+)for alternatives look here:
http://php.net/manual/en/book.simplexml.php
http://www.php.net/manual/en/book.dom.php