@ivanhoe, mislim da preg_match nije dobro, jer je overkill da se nešto uradi, ili promjeni... možeš sve uraditi sa CSS selektorima (barem ja što sam radio scrapinga)...
Zend Query (nisam testirao)
PHP kôd:
$dom = new Zend_Dom_Query($html);
$results = $dom->query('a[href*="cenovnik"]');
foreach ($results as $result)
echo $result->href;
Simple HTML DOM
PHP kôd:
$e = $html->find('a[href*="cenovnik"]', 0);
echo $e->href;
$e = $html->find('a[text^="Prices"]', 0);
echo $e->href, $e->innertext;
[attribute] Matches elements that have the specified attribute.
[attribute=value] Matches elements that have the specified attribute with a certain value.
[attribute!=value] Matches elements that don't have the specified attribute with a certain value.
[attribute^=value] Matches elements that have the specified attribute and it starts with a certain value.
[attribute$=value] Matches elements that have the specified attribute and it ends with a certain value.
[attribute*=value] Matches elements that have the specified attribute and it contains a certain value.