Why is this an issue?

A regular expression is a sequence of characters that specifies a match pattern in text. Among the most important concepts are:

Many of these features include shortcuts of widely used expressions, so there is more than one way to construct a regular expression to achieve the same results. For example, to match a two-digit number, one could write [0-9]{2,2} or \d{2}. The latter is not only shorter but easier to read and thus to maintain.

This rule recommends replacing some quantifiers and character classes with more concise equivalents:

r"[0-9]"        # Noncompliant - same as r"\d"
r"[^0-9]"       # Noncompliant - same as r"\D"
r"[A-Za-z0-9_]" # Noncompliant - same as r"\w"
r"[\w\W]"       # Noncompliant - same as r"."
r"a{0,}"        # Noncompliant - same as r"a*"

Use the more concise version to make the regex expression more readable.

r"\d"
r"\D"
r"\w"
r"."
r"a*"