I am try to capture "Coffret bougies P'tits biscuits" in a HTML parsed page. I have got the page into a $page2 variable and I want to retrieve each of the product names there are. Here is the regex I have come to :
/<div\sclass=\"details\">\n\s*<h3>(.*)<a\shref=\"(.*)\">(.*)<\/a>/
and the code
preg_match_all('/<div\sclass=\"details\">\n\s*<h3>(.*)<a\shref=\"(.*)\">(.*)<\/a>/', $page2, $matcher);
print_r($matcher);
this is supposed to capture all of the HTML code that looks like this :
<div class="details">
<h3><a href="/FR/fr/produits/fiche/coffret-bougies-ptits-biscuits-138156.htm">Coffret bougies P'tits biscuits</a>
https://www.debuggex.com/r/ddZCM3K_GQ4PkIPV/0
But for some reason I don't understand it keep returning an empty array.
Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) [3] => Array ( ) )
(.*?)(.*?)<\/a>/ but it still doesn't work .. :(