Instead of regular expressions, use the php DOM parser. You are looking for something like this (warning of unverified code):
$domd = new DOMDocument();
libxml_use_internal_errors(true);
$domd->loadHTML($html_content);
libxml_use_internal_errors(false);
$domx = new DOMXPath($domd);
$items = $domx->query("//h3[position() = 1]");
echo $items->item(0)->textContent;
source
share