Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的脚本中有这一行
listMainString = inputLine.split("}]},");
我得到这个错误:
java.util.regex.PatternSyntaxException: Syntax error in regexp pattern near index 1: }
有什么解决办法??谢谢
试试这个代码
listMainString = inputLine.split("}\\]},");
正则表达式中使用的控制字符应转义以使其有意义。
您需要转义所有在正则表达式中具有特殊含义的字符。
listMainString = inputLine.split("\\}\\]\\},");