rspec/rules/S5842/python/rule.adoc
Nils Werner 23d7c9c90f
Modify rule S5842: Add Python as covered language (#536)
* Modify rule S5842: Add Python as covered language

* Fix inline comments
2021-10-28 12:56:25 +00:00

21 lines
469 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
----
r"(?:)*" # same as the empty regex, the '*' accomplishes nothing
r"(?:|x)*" # same as the empty regex, the alternative has no effect
r"(?:x|)*" # same as 'x*', the empty alternative has no effect
r"(?:x*|y*)*" # same as 'x*', the first alternative would always match, y* is never tried
r"(?:x?)*" # same as 'x*'
r"(?:x?)+" # same as 'x*'
----
== Compliant Solution
----
r"x*"
----