You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Character classes in regular expressions represent sets of characters, so there is no need to specify the same character twice in one character class. Duplicate characters in character classes are at best useless, and may even indicate a latent bug.
Recommendation
Determine whether a character is simply duplicated or whether the character class was in fact meant as a group. If it is just a duplicate, then remove the duplicate character. If was supposed to be a group, then replace the square brackets with parentheses.
The text was updated successfully, but these errors were encountered:
Here are the two LGTM warnings:
The relevant lines of code:
pdf_build_src/process_markdowns.py
pdf_build_src/process_markdowns.py
Indeed, there are two
\w
within classes of characters delimited by [] and not groups of characters delimited by ():[\w\-\w]
[#\w\-._\w]
See Duplication in regular expression character class:
The text was updated successfully, but these errors were encountered: