Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regex for ignoring multi-line comments. #1212

Merged
merged 2 commits into from
Sep 5, 2023

Conversation

sagev9000
Copy link
Contributor

.* 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.

@TheJackiMonster
Copy link
Collaborator

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.

@TheJackiMonster TheJackiMonster added this to the 0.16.0 milestone Sep 5, 2023
@TheJackiMonster TheJackiMonster merged commit 87da52e into olivierkes:develop Sep 5, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants