I have encountered a very bizzare issue with regex in Python. I have the following code that is supposed to search through the HTML file and replace a pattern