I'm having a little trouble with this pattern - "/([a-z-_0-9/\:.]*.(jpg|jpeg|png))/i" - within the preg_match_all function. Admittedly, my regex is a little weak so I suspect something is wrong within there.
Here's what I have at the moment -
preg_match_all("/([a-z\-_0-9\/\:\.]*\.(jpg|jpeg|png))/i", $raw, $matching)
With $raw being just the HTML from this page - http://www.topshop.com/webapp/wcs/stores/servlet/ProductDisplay?beginIndex=0&viewAllFlag=&catalogId=33057&storeId=12556&productId=13936776&langId=-1&categoryId=&parent_category_rn=&searchTerm=TS05K01FBLC&resultCount=1&geoip=home
There are a bunch of images on the page that aren't being pulled in, all I'm getting is the following ([0] of the $matching array - the rest is repeat data in a different format)
array(8) {
[0]=>
string(77) "http://media.topshop.com/wcsstore/TopShop/images/catalog/05K01FBLC_normal.jpg"
[1]=>
string(143) "/wcsstore/ConsumerDirectStorefrontAssetStore/images/colors/color7/cms/pages/static/static-0000067510/images/tact-wk24-LFWshipping_UK-ROW-EU.jpg"
[2]=>
string(76) "http://media.topshop.com/wcsstore/TopShop/images/catalog/05K01FBLC_large.jpg"
[3]=>
string(77) "http://media.topshop.com/wcsstore/TopShop/images/catalog/05K01FBLC_normal.jpg"
[4]=>
string(40) "//assets.pinterest.com/images/PinExt.png"
[5]=>
string(41) "http://platform.tumblr.com/v1/share_4.png"
[6]=>
string(163) "http://media.topshop.com/wcsstore/ConsumerDirectStorefrontAssetStore/images/colors/color7/cms/pages/static/static-0000067528/images/PDP-wk24-LFWshipping_ROW-EU.jpg"
[7]=>
string(119) "/wcsstore/ConsumerDirectStorefrontAssetStore/images/colors/color7/cms/pages/static/static-0000008560/images/onthego.png"
}
If anyone could give me a little information as to why this isn't pulling in every image on the page and just these 8 images?
Is there something in the regular expression thats limiting what I get?
I'm not getting this jpg link - http://media.topshop.com/wcsstore/TopShop/images/catalog/05K01FBLC_3_large.jpg - Even though it's on the page
Any help would be most appreciated.
Greg