def __init__(self, name, combinator=None):
        self.name = name
        self.combinator = combinator
        self.next_selector = None

        selector_patterns = {
            'types': self.RE.type_selector,
            'ids': self.RE.id_selector,
            'classes': self.RE.class_selector,
            'pseudos': self.RE.pseudo_selector,
            'attrs': self.RE.attr_selector,
        }

        matches = {}

        while True:
            pattern_matched = False
            for key, pattern in selector_patterns.items():
                match = regex.search(r'^{}'.format(pattern), name)
                if match:
                    i, pos = match.span()
                    if key not in matches:
                        matches[key] = []
                    matches[key].append(match.groups())
                    name = name[pos:]
                    pattern_matched = True
            if not pattern_matched:
                break

        self.typ = None
        for types in matches.pop('types', []):
            self.typ = types[0]

        self.id_ = None
        for ids in matches.pop('ids', []):
            self.id_ = ids[0]

        self.classes = [a[0] for a in matches.pop('classes', [])]

        self.attrs = [
            Attr(l, o, r.strip())
            for l, o, r in matches.pop('attrs', [])
        ]
        self.pseudos = [
            Pseudo(*a[1:])
            for a in matches.pop('pseudos', [])
        ]
dataset/ETHPy150Open caioariede/pyq/sizzle/selector.py/Selector.__init__/original