Replaced multiple .replace statements with one re.sub statement