title: Java String ReplaceAll method giving illegal repetition error?
body: <p>I have a string and when I try to run the <code>replaceAll</code> method, I am getting this strange error:  </p>
  
  <pre><code>String str = "something { } , op";
  str = str.replaceAll("o", "\n"); // it works fine
  str = str.replaceAll("{", "\n"); // does not work
  </code></pre>
  
  <p>and i get a strange error:  </p>
  
  <pre><code>Exception in thread "main" java.util.regex.PatternSyntaxException:
  Illegal repetition {  
  </code></pre>
  
  <p>How can I replace the occurrences of <code>"{"</code> ?</p>