For matching all H tags in html code you need to do this:
preg_match_all('/<h([1-6]).*[^>]*>(.*)<\/h([1-6])>/',$content,$all_h_tags);
Where $content is a string variable with html tags and $all_h_tags is a variable where all matches are put.
For matching all H tags in html code you need to do this:
preg_match_all('/<h([1-6]).*[^>]*>(.*)<\/h([1-6])>/',$content,$all_h_tags);
Where $content is a string variable with html tags and $all_h_tags is a variable where all matches are put.