Thank you very much!!

I have modified it a bit to get the h-tags AND the id´s of the h-tags:

preg_match_all('|<h.*?id=\"([^\"]*)\".*?>(.*)</h[^>]+>|iU', ...)