Regex fails if there are `()` small brackets present in text

I am trying to build a regular expression that detects the presence of header tags in HTML, and then captures the textual content of the header tag. I have also tried to make it a little robust by also taking care of nested tags present inside the header tags.

Here is the regular expression that I am currently working with.

<h1.*?>s*(<.*?>)*s*(</.*?>)*s*(<.*?>)*s*b(.+)bs*(</.*?>)*s*</h1>

It works pretty well with many test examples. However, for some reason which I am not able to understand, this expression fails if there are brackets, e.g, small brackets present inside the textual content area.

Following is a sample tag, which I am trying to parse, my specified expression fails to properly work with it.

<h1><span id="Civil_rights_activist_in_South_Africa_.281893.E2.80.931914.29"></span><span class="mw-headline" id="Civil_rights_activist_in_South_Africa_(1893–1914)">Civil rights activist in South Africa (1893–1914)</span></h1>

Interestingly, it works just fine if I remove the small brackets from the textual area which I am trying to capture. The following example works just fine.

<h1><span id="Civil_rights_activist_in_South_Africa_.281893.E2.80.931914.29"></span><span class="mw-headline" id="Civil_rights_activist_in_South_Africa_(1893–1914)">Civil rights activist in South Africa 1893–1914</span></h1>

The textual area in both samples is Civil rights activist in South Africa (1893–1914)
with and without the small brackets surroundings the years.

The textual content can be anything, so I can not always look for the presence of brackets. e.g, I also want to make sure that my regex does not miss the following cases.

<h1> Hello World</h1>

<h1 id="main_heading"> Hello World</h1>

<h1><span class="bold"> Hello World </span></h1>