I'm pretty sure you need two calls to re.sub. This isn't a Python issue so much as a regular expression issue, and as far as I know this isn't possible.
How to use the regular expression functions provided by the ‘re’ library to match, search, and replace text in your Python programs. Regular expressions, or “regex,” is a system for finding complex ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results