Remove IMG tag from HTML using Regex - Python 2.7
<p>I have HTML and I want to remove IMG tag from it.</p>

<p>I am not good at regex, I have this function but it does not remove IMG tag</p>

<pre><code>def remove_img_tags(data):
    p = re.compile(r'&lt;img.*?/&gt;')
    return p.sub('', data)
</code></pre>

<p>What is the proper regex? I don't want to use any library.</p>

<p>Try this:</p>

<pre><code>image_tag = re.compile(r'&lt;img.*?/&gt;').search(data).group()
data.replace(image_tag, '')
</code></pre>

python regex python-2.7