title: replaceAll - Java
body: <p>I have this output <code>[4,-3],[-3,-1],[2,-4],[-4,1]</code>
  and this is the code that gives me this output:</p>
  
  <pre><code>public static String[] arg() throws IOException {
      String prova =getString().replaceAll(" 0","] [");
      String prova1=prova.replaceFirst("0","[");
      String prova2=prova1.replaceAll("%0","]");
      String prova3=prova2.replaceAll(" ",",");
      String prova4=prova3.replaceAll("],["," ");
      System.out.println(prova4);
      String[] strArray = getString().split(" ");
  
      //System.out.println(Arrays.toString(strArray));
      return strArray;
  
  }
  </code></pre>
  
  <p>My problem is that I would have as output this [4,-3] [-3,-1] [2,-4] [-4,1] that is, a blank space in place of this <code>],[</code>. I think that <code>String prova4=prova3.replaceAll("],["," ");</code> should do this, but it produce several error.</p>
  
  <p>This is the error: <code>Unclosed character class near index 2
  ],[</code></p>