code: def _parse_tag(self, tag):
          
          if not tag.startswith(self.tag_opener) or not tag.endswith(self.tag_closer) or ('\n' in tag) or ('\r' in tag):
              return (False, tag, False, None)
          tag_name = tag[len(self.tag_opener):-len(self.tag_closer)].strip()
          if not tag_name:
              return (False, tag, False, None)
          closer = False
          opts = {}
          if tag_name[0] == '/':
              tag_name = tag_name[1:]
              closer = True
          # Parse options inside the opening tag, if needed.
          if (('=' in tag_name) or (' ' in tag_name)) and not closer:
              tag_name, opts = self._parse_opts(tag_name)
          return (True, tag_name.strip().lower(), closer, opts)
docs: Given a tag string (characters enclosed by []), this function will
          parse any options and return a tuple of the form:
              (valid, tag_name, closer, options)