docs: def detag_string(self, string):
          """Extracts tags from string.
  
             returns (string, list) where
             string: string has tags replaced by indices (<BR>... => <0>, <1>, <2>, etc.)
             list: list of the removed tags ('<BR>', '<I>', '</I>')
          """
          counter = itertools.count(0)
          count = lambda m: '<%s>' % next(counter)
          tags = self.tag_pattern.findall(string)
          tags = [''.join(tag) for tag in tags]
          (new, nfound) = self.tag_pattern.subn(count, string)
          if len(tags) != nfound:
              raise Exception('tags dont match:' + string)
          return (new, tags)