I encountered an unexpected behavior of String#replace()
method.
const R = S.replace(A, B)
Even if both the A
and the B
don't include line breaks, but the R
and the S
has the different number of line breaks.
I tried it on Node.js 6.14.2
, 8.11.2
, and 10.1.0
, on Windows 7. All of those has the same result.
Is this a bug?
Repro: https://github.com/mysticatea/string-replace-unexpected-behavior