22 lines
403 B
Plaintext
Raw Permalink Normal View History

== Why is this an issue?
include::../description.adoc[]
=== Noncompliant code example
2022-02-04 17:28:24 +01:00
[source,python]
----
r"[0-99]" # Noncompliant, this won't actually match strings with two digits
r"[0-9.-_]" # Noncompliant, .-_ is a range that already contains 0-9 (as well as various other characters such as capital letters)
----
=== Compliant solution
2022-02-04 17:28:24 +01:00
[source,python]
----
r"[0-9]{1,2}"
r"[0-9.\\-_]"
----