@classmethod<EOL><INDENT>def parse_rule(cls, txt):<DEDENT>
types = {"<STR_LIT>": GlobRule,<EOL>"<STR_LIT>": RegexRule,<EOL>"<STR_LIT>": RangeRule,<EOL>"<STR_LIT>": TimestampRule,<EOL>"<STR_LIT>": TimestampRule}<EOL>label, txt = Rule._parse_label(txt)<EOL>if label is None:<EOL><INDENT>if '<STR_LIT:*>' in txt:<EOL><INDENT>label = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>label = "<STR_LIT>"<EOL><DEDENT><DEDENT>elif label not in types:<EOL><INDENT>raise ConfigurationError(<EOL>"<STR_LIT>" % label)<EOL><DEDENT>rule_cls = types[label]<EOL>txt_ = "<STR_LIT>" % (label, txt)<EOL>try:<EOL><INDENT>rule = rule_cls._parse(txt_)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise ConfigurationError("<STR_LIT>"<EOL>% (txt_, e.__class__.__name__, str(e)))<EOL><DEDENT>return rule<EOL>
Parse a rule from a string.

        See rezconfig.package_filter for an overview of valid strings.

        Args:
            txt (str): String to parse.

        Returns:
            `Rule` instance.