filter.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:Ellis 作者: Frzk 项目源码 文件源码
def from_string(cls, raw_filter, rule_limit):
        """
        Creates a new Filter instance from the given string.

        *raw_filter* is the raw filter : a string that may contain several
        regular expressions (separated by a newline char) and tags.

        *rule_limit* is the Rule's limit above which the Action is executed.

        Raises :class:`exceptions.ValueError` if the given string could not be
        compiled in at least one suitable :class:`re.RegexObject`.

        Returns a new :class:`Filter` instance.
        """
        parsed_filter = cls.replace_tags(raw_filter)
        regexes = cls.build_regex_list(parsed_filter, rule_limit)

        return cls(regexes)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号