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

Python: False Positive in py/regex/duplicate-in-character-class #1181

Closed
s0 opened this issue Mar 29, 2019 · 0 comments · Fixed by #1499
Closed

Python: False Positive in py/regex/duplicate-in-character-class #1181

s0 opened this issue Mar 29, 2019 · 0 comments · Fixed by #1499
Labels

Comments

@s0
Copy link
Contributor

s0 commented Mar 29, 2019

Example: https://lgtm.com/projects/g/edemo/PDEngine/snapshot/0aef4231561da169109752d6fdb020f259db5f97/files/tools/getGithubIssues?sort=name&dir=ASC&mode=heatmap#x8b87d5afc0b67d28:1

Reported here: https://discuss.lgtm.com/t/false-positive-python-regexp/1967

It looks like character sets that include [ confuse the grouping. In the above regex, the only square brackets that define a character class sets are as follows (the rest are escaped or are in the class themselves):

\[(?P<txt>[^[]*)\]\((?P<uri>[^)]*)
          ^  ^              ^  ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant