python
python copied to clipboard
raw-string regex comment
The re.VERBOSE
flag allows to write comments inside the string, however that comment should end at the end of string. The current behaviour is broken:
pattern = compile(r"""
\d\t
# this part is a comment""", MULTILINE | VERBOSE)
# ^
# should end here
Currently the entire line is highlighted as a comment.