java.util.regex.PatternSyntaxException: Unexpected internal error near index 1 \^

 

String filePath ="/f/f/f\\aauuf";
String tt = filePath.replaceAll("\\\\", "/");
System.out.println(tt);

 

必须使用四个反斜杠才行,因为,每两个代表一个"\",转义字符。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2021-10-06
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
相关资源
相似解决方案