def key_rule(self, regex, verifier):
        """Add a rule with a pattern that should apply to all keys.

        Any key not explicitly listed in an add_required or add_optional rule
        must match ONE OF the rules given in a call to key_rule().
        So these rules are all OR'ed together.

        In this case you should pass a raw string specifying a regex that is
        used to determine if the rule is used to check a given key.


        Args:
            regex (str): The regular expression used to match the rule or None
                if this should apply to all
            verifier (Verifier): The verification rule
        """

        if regex is not None:
            regex = re.compile(regex)

        self._additional_key_rules.append((regex, verifier))
Add a rule with a pattern that should apply to all keys.

        Any key not explicitly listed in an add_required or add_optional rule
        must match ONE OF the rules given in a call to key_rule().
        So these rules are all OR'ed together.

        In this case you should pass a raw string specifying a regex that is
        used to determine if the rule is used to check a given key.


        Args:
            regex (str): The regular expression used to match the rule or None
                if this should apply to all
            verifier (Verifier): The verification rule