def match(self, pattern_codes):
        # Optimization: Check string length. pattern_codes[3] contains the
        # minimum length for a string to possibly match.
        # brython..  the optimization doesn't work 
        #if pattern_codes[0] == OPCODES["info"] and pattern_codes[3]:
        #    if self.end - self.string_position < pattern_codes[3]:
        #        #_log("reject (got %d chars, need %d)"
        #        #         % (self.end - self.string_position, pattern_codes[3]))
        #        return False
        
        dispatcher = _OpcodeDispatcher()
        self.context_stack.append(_MatchContext(self, pattern_codes))
        has_matched = None
        while len(self.context_stack) > 0:
            context = self.context_stack[-1]
            has_matched = dispatcher.match(context)
            if has_matched is not None: # don't pop if context isn't done
                self.context_stack.pop()
        return has_matched
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/_sre.py/_State.match/original