Regex Script Help

I think I did post this some time ago, but can’t find original thread to rehash. I have some questions regarding lifting data from a particular webpage. What makes this unusual and why I need to ask some questions is that within the tags, there is a lot of white space and the data doesn’t actually sit within closed tags eg. data, it falls like this

[code]


£6.99
                                    </td>[/code]

With the “£6.99” being what I want to extract and use. for example, this code works perfectly for a different website.

[code]$url = ‘http://www.cheapsmells.com/viewProduct.php?id=3462’;
$html = file_get_contents($url);

preg_match(’/<div class=‘productOurPrice’?>(.+?)(d+.d+)(.+?)?/’, $html, $match);
$out = $match[2];[/code]

Where the url is http://www.directcosmetics.com/results/ … code=34744 which is where the first example where the whitespace is, how can I adjust the above regex to obtain the information required, in this case literally “6.99” and nothing more. Is it possible because it’s not within closed brackets?

Any help you can shed my way would be greatly appreciated.

Cheers ;D

Sponsor our Newsletter | Privacy Policy | Terms of Service