On Tue, 6 Sep 2022 20:36:27 GMT, Sean Mullan <mul...@openjdk.org> wrote:

>> My understanding: In regex, there is no need to escape `"`, so `"` is the 
>> same as `"`.
>
> Ok,but the regex is `"\\""`, so shouldn't it keep the double-backslash at the 
> beginning (`\`)?, i.e.:
> 
> `...replaceAll("\"", "\\\\\\""));`

The regex `"` is enough, so as a Java string it is `"""`.

Before this code change, we thought the regex should be `"` (not wrong, just 
wasteful), and we wrote it as `"\\""` in Java.

The replacement string is another thing and the quotation mark is also not 
special there, but IJ has not given any suggestion.

-------------

PR: https://git.openjdk.org/jdk/pull/9972

Reply via email to