import re STRIP_EXTLINK_XML_RE = re.compile(r"") def strip_extlink_xml(unstr): unstr = unstr.replace("", "") unstr = STRIP_EXTLINK_XML_RE.sub("", unstr) return unstr def test_strip_extlink_xml(): assert strip_extlink_xml("asdf") == "asdf" assert strip_extlink_xml("""LOCKSS (2014) Available: http://lockss.org/. Accessed: 2014 November 1.""") == \ """LOCKSS (2014) Available: http://lockss.org/. Accessed: 2014 November 1."""