title: Java replaceAll with newline symbol
body: <p>the newline symbol \n is causing me a bit of trouble when i try to detect and replace it:
  This works fine:</p>
  
  <pre><code>String x = "Bob was a bob \\n";
  String y = x.replaceAll("was", "bob");
  System.out.println(y);
  </code></pre>
  
  <p>butt this code does not give the desired result</p>
  
  <pre><code>String x = "Bob was a bob \\n";
  String y = x.replaceAll("\n", "bob");
  System.out.println(y);
  </code></pre>