Delete trailing marks ]]
<p>Doing some regex and I can't sus out how I can get rid of the ]] marks from this string</p>

<p>Regex:</p>

<pre><code>&lt;title&gt;&lt;!\[CDATA\[(.*?)&lt;/title&gt;
</code></pre>

<p>String:</p>

<pre><code>&lt;item&gt;
            &lt;title&gt;&lt;![CDATA[Coronation Street star Jean Alexander dies aged 90]]&gt;&lt;/title&gt;
            &lt;description&gt;
</code></pre>

<p>Returned:
Coronation Street star Jean Alexander dies aged 90]]</p>

<p>What I want returned:
Coronation Street star Jean Alexander dies aged 90</p>

<p>You have to escape the square brackets in the end too.</p>

<pre><code>string = "&lt;title&gt;&lt;![CDATA[Coronation Street star Jean Alexander dies aged 90]]&gt;&lt;/title&gt;"
result = re.findall(r"\[.*\[(.*?)\]\]", string)
print(result)
</code></pre>

python regex