23 lines
476 B
Plaintext
23 lines
476 B
Plaintext
== Why is this an issue?
|
|
|
|
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"
|
|
----
|
|
|