docs: def retag_string(self, string, tags):
          """substitutes each tag back into string, into occurrences of <0>, <1> etc"""
          for i, tag in enumerate(tags):
              bracketed = '<%s>' % i
              string = re.sub(bracketed, tag, string, 1)
          return string