I have a regular expression to search for complete h1 tags (from start of <h1>
to end of </h1>
) in a content but it searches for the whole content
Regular expression
<h1.*<\/h1>
Content to search for
<h1 style=""></h1><span> alsjd alkj dalsd a</span><h1>asdsadsa</h1>
The result is one match only from first occurrence of starting h1 to last occurrence of ending h1. It matches the whole content.
I want it to give me 2 occurrence of starting and ending h1 tags like the result should be
<h1 style=""></h1> and
<h1>asdsadsa</h1>