- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
package com.google.gwt.regexp.shared;
<...>
public class RegExp {
// In JS syntax, a \ in the replacement string has no special meaning.
// In Java syntax, a \ in the replacement string escapes the next character,
// so we have to translate \ to \\ before passing it to Java.
private static final Pattern REPLACEMENT_BACKSLASH = Pattern.compile("\\\\");
// To get \\, we have to say \\\\\\\\:
// \\\\\\\\ --> Java string unescape --> \\\\
// \\\\ ---> Pattern replacement unescape in replacement preprocessing --> \\
private static final String REPLACEMENT_BACKSLASH_FOR_JAVA = "\\\\\\\\";
gost 04.02.2016 14:49 # +12
Видит \ \— в \\ \\\\
Сунул \ \\\\\\ в \\
\\ \\\\ \\ \\\\\\ \
WGH 07.02.2016 14:41 # +1
wvxvw 10.02.2016 16:57 # +5
kegdan 11.02.2016 10:53 # +3
666_N33D135 25.05.2018 14:14 # −1
666_N33D135 25.05.2018 15:05 # −1
:(
dmli 13.02.2016 23:31 # −1