Print html tag regex

I want to display only the start of the html tags

<div id="content"></div>
<div id="nav"></div>

if the above is given, i only want to display the tags that has html attributes

<div id="content">
<div id="nav">

I try to do that below but I get instead.


import re
file = open('test.html')
test =
lines = test.splitlines()
b= re.findall(r'<?=.*?>',test)
for a in b:

how to i fix my code so that i get

<div id="content">
<div id="nav">

instead of


Replace your regex with '<.*?=.*?>'