You can remove head tag from HTML text using Beautiful Soup in Python using decompose() function. Try this Python code,
from bs4 import BeautifulSoup
my_string = '''
<html>
<head>
<p>
this is a paragraph tag
</p>
</head>
<meta>
<p>
this is a different paragraph tag
</p>
</meta>
</html>
'''
soup = BeautifulSoup(my_string)
soup.find('head').decompose() # find head tag and decompose/destroy it from the html
print(soup) # prints html text without head tag
Prints,
<html>
<meta/>
<p>
this is a different paragraph tag
</p>
</html>
Also, although regex way is not recommended, but if the tag you want to remove isn't nested, you can remove it using the regex you mentioned in your comments using these Python codes. But always avoid using regex for parsing nested structures and go for a proper parser.
import re
my_string = '''
<html>
<head>
<p>
this is a paragraph tag
</p>
</head>
<meta>
<p>
this is a different paragraph tag
</p>
</meta>
</html>
'''
print(re.sub(r'(?s)<head>.*?</head>', '', my_string))
Prints following and notice the usage of (?s) which is needed to enable dot matching newlines as your html is spread across multiple lines,
<html>
<meta>
<p>
this is a different paragraph tag
</p>
</meta>
</html>