28 lines
436 B
Plaintext
28 lines
436 B
Plaintext
== Why is this an issue?
|
|
|
|
include::../description.adoc[]
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,python]
|
|
----
|
|
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*"
|
|
----
|
|
|
|
=== Compliant solution
|
|
|
|
[source,python]
|
|
----
|
|
r"\d"
|
|
r"\D"
|
|
r"\w"
|
|
r"."
|
|
r"a*"
|
|
----
|
|
|
|
include::../implemtation.adoc[]
|