Match rule and set attribute codes.

def match(self, filename, line, codes):
        """Match rule and set attribute codes."""
        if self.regex_match_any(line, codes):
            if self._vary_codes:
                self.codes = tuple([codes[-1]])
            return True