2021-10-29 09:54:32 +02:00
|
|
|
include::../description.adoc[]
|
2021-09-06 16:45:18 +02:00
|
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
str.split(/.*?x?/); // Noncompliant, this will behave just like "x?"
|
|
|
|
/^.*?$/.test(str); // Noncompliant, replace with ".*"
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
----
|
|
|
|
str.split(/.*?x/);
|
|
|
|
/^.*$/.test(str);
|
|
|
|
----
|
|
|
|
|