rspec/rules/S6395/python/rule.adoc

29 lines
372 B
Plaintext
Raw Normal View History

include::../desciption.adoc[]
== Noncompliant Code Example
[source,python]
----
r"(?:number)\d{2}"
----
== Compliant Solution
[source,python]
----
r"number\d{2}"
r"(?:number)?\d{2}"
----
== Exceptions
This rule does not report an issue if the non-capturing group is an alternation.
[source,python]
----
r"(?:number|string)"
----
include::../implementation.adoc[]