java.util.regex.PatternSyntaxException: Unclosed character class near index解决办法

使用str.split("[")时,出现java.util.regex.PatternSyntaxException: Unclosed character class near index [ ^的问题

解决办法为在[加上\\转义


你可能感兴趣的:(string用法,java)