Python re.sub back reference not back referencing

I have the following: <text top="52" left="20" width="383" height="15" font="0"><b>test</b></text> and I have the following: fileText = re.sub("<b>(.*?)</b>", "1", fileText, flags=re.DOTALL) In which fileText is the string I posted above. When I print out fileText after I run the regex replacement I get back <text top="52" left="20" width="383" height="15" font="0"></text> instead of the expected <text … Read more