def test_detect_verbose(self):
"""Test verbose."""
pattern = bre.compile_search(
r'''
This is a # \Qcomment\E
This is not a \# \Qcomment\E
This is not a [#\ ] \Qcomment\E
This is not a [\#] \Qcomment\E
This\ is\ a # \Qcomment\E
''',
re.VERBOSE
)
self.assertEqual(
pattern.pattern,
r'''
This is a # \\Qcomment\\E
This is not a \# comment
This is not a [#\ ] comment
This is not a [\#] comment
This\ is\ a # \\Qcomment\\E
'''
)
评论列表
文章目录