Closed sagev9000 closed 10 months ago
.* doesn't pick up newlines, so multi-line comments were not being correctly dropped from the word count. [\s\S] is a simple workaround, though any of [\w\W], [\d\D], or (.|\s) should also work.
.*
[\s\S]
[\w\W]
[\d\D]
(.|\s)
You are right. But I think we should use the re.DOTALL or re.S flag instead since it's more legible. See here and in the docs.
re.DOTALL
re.S
.*
doesn't pick up newlines, so multi-line comments were not being correctly dropped from the word count.[\s\S]
is a simple workaround, though any of[\w\W]
,[\d\D]
, or(.|\s)
should also work.