string_test.py 文件源码

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

项目:filters 作者: eflglobal 项目源码 文件源码
def test_pass_regex_library_support(self):
        """
        The Regex Filter also supports precompiled patterns using the
        ``regex`` library.
        """
        # Roughly, "Hi there!" in Burmese.
        word = '\u101f\u102d\u102f\u1004\u103a\u1038!'

        # Note that :py:func:`regex.compile` automatically adds the
        # ``UNICODE`` flag for you when the pattern is a unicode.
        pattern = regex.compile(r'\w+')

        self.assertFilterPasses(
            self._filter(word, pattern=pattern),
            ['', '!'],
        )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号