title: String.split() at a meta character +
body: <p>I'm making a simple program that will deal with equations from a String input of the equation
  When I run it, however, I get an exception because of trying to replace the " +" with a " +" so i can split the string at the spaces. How should I go about using </p>
  
  <p>the string replaceAll method to replace these special characters? Below is my code</p>
  
  <p><em>Exception in thread "main" java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 0
  +
  ^</em></p>
  
  <pre><code> public static void parse(String x){
         String z = "x^2+2=2x-1";
  
         String[] lrside =  z.split("=",4);
         System.out.println("Left side: " + lrside[0] + " / Right Side: " + lrside[1]);
         String rightside = lrside[0];
         String leftside = lrside[1];
  
         rightside.replaceAll("-", " -");
         rightside.replaceAll("+", " +");
         leftside.replaceAll("-", " -"); leftside.replaceAll("+", " +");
         List&lt;String&gt; rightt = Arrays.asList(rightside.split(" "));
         List&lt;String&gt; leftt = Arrays.asList(leftside.split(" "));
  
         System.out.println(leftt);
         System.out.println(rightt);
  </code></pre>