Unclosed Character Class Error?

前端 未结 5 1562
难免孤独
难免孤独 2020-12-10 01:59

Here is the error:

Exception in thread \"main\" java.util.regex.PatternSyntaxException: Unclosed character class near index 3
], [
   ^
    at java.util.rege         


        
5条回答
  •  失恋的感觉
    2020-12-10 02:31

      .split("], [")
                 ^---start of char class
                      end----?
    

    Change it to

    .split("], \[")
               ^---escape the [
    

提交回复
热议问题