def _registrant_publication(reg_pub: str, rules: List[Tuple[str, str, int]]) -> Tuple[str, str]:
        """Separate the registration from the publication in a given
        string.

        :param reg_pub: A string of digits representing a registration
            and publication.
        :param rules: A list of registrant rules which designate where
            to separate the values in the string.
        :returns: A (registrant, publication) tuple of strings.
        """
        for rule in rules:
            if rule[0] <= reg_pub[:-1] <= rule[1]:
                reg_len = rule[2]
                break
        else:
            raise Exception(f"Registrant/Publication '{reg_pub}' not found in registrant rule list.")
        registrant, publication = reg_pub[:reg_len], reg_pub[reg_len:]
        return registrant, publication
Separate the registration from the publication in a given
        string.

        :param reg_pub: A string of digits representing a registration
            and publication.
        :param rules: A list of registrant rules which designate where
            to separate the values in the string.
        :returns: A (registrant, publication) tuple of strings.
        
faker/providers/isbn/__init__.py