rspec/rules/S5994/php/rule.adoc
2022-02-04 16:28:24 +00:00

21 lines
448 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
[source,php]
----
"/a++abc/" // Noncompliant, the second 'a' never matches
"/\d*+[02468]/" // Noncompliant, the sub-pattern "[02468]" never matches
----
== Compliant Solution
[source,php]
----
"/aa++bc/" // Compliant, for example it can match "aaaabc"
"/\d*+(?<=[02468])/" // Compliant, for example it can match an even number like "1234"
----