file_watch.py 文件源码

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

项目:darkc0de-old-stuff 作者: tuwid 项目源码 文件源码
def compilePatterns(self):
        for text, score, match in self.regexs:
            self.debug("Add regex pattern: %r" % text)
            yield (text, score, match)

        for text, score in self.patterns.iteritems():
            regex = r'%s' % re.escape(text.lower())
            self.debug("Create pattern regex: %r" % regex)
            match = re.compile(regex, re.IGNORECASE).search
            yield (text, score, match)

        for text, score in self.words.iteritems():
            regex = r'(?:^|\W)%s(?:$|\W)' % re.escape(text.lower())
            self.debug("Create word regex: %r" % regex)
            match = re.compile(regex, re.IGNORECASE).search
            yield (text, score, match)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号