'Takes a single line and tries to parse it as a group name. Returns the
group name if successful, or raises an error.'

def _parse_group_name(self, line):

    m = self.patterns['groupname'].match(line)
    if m:
        return m.group(1)
    self._raise_error(('Expected    group    name,    got:    %s' % line))
