2023-05-03 11:06:20 +02:00
|
|
|
== Why is this an issue?
|
|
|
|
|
2021-07-20 10:29:46 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
=== Noncompliant code example
|
2021-07-20 10:29:46 +02:00
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,javascript]
|
2021-07-20 10:29:46 +02:00
|
|
|
----
|
|
|
|
"cc̈d̈d".replace(/[c̈d̈]/g, "X"); // result is "XXXXXX" and not expected "cXXd"
|
|
|
|
----
|
|
|
|
|
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
=== Compliant solution
|
2021-07-20 10:29:46 +02:00
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,javascript]
|
2021-07-20 10:29:46 +02:00
|
|
|
----
|
|
|
|
"cc̈d̈d".replace(/c̈|d̈/g, "X"); // result is "cXXd"
|
|
|
|
----
|