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),
['', '!'],
)
评论列表
文章目录