I have this line with 2 html tags:
<p class="mb-40px"><!-- ARTICOL FINAL -->
I use Python, and this regex to delete the first tag, so to remain only <!-- ARTICOL FINAL -->
THIS IS THE REGEX CODE:
if len(re.findall('(<p class="mb-40px">)(<\!-- ARTICOL FINAL -->)', page_html, flags=re.IGNORECASE)) != 0:
page_html = re.sub('(<p class="mb-40px">)(<\!-- ARTICOL FINAL -->)', '\2', page_html, flags=re.IGNORECASE)
counter_img += 1
Seems that replacement was made, but instead of second tag, I get this:
STX (I believe is ANSI or UTF-8 character). See the print screen: