title: using parenthesis replaceAll method Java
body: <p>I would like to change a word in a sentence, but the word has parenthesis. I keep it in the String variable. Inside of the variable <strong>st</strong> I have </p>
  
  <p><code>manages(P0,MT0)</code></p>
  
  <p>Inside of other String variable <code>DES</code> I have the following sentence:</p>
  
  <p><code>query(MT0, P0) :- not(manages(P0,MT0)), ins_manages(P0,MT0), not(physician(P0)), not(ins_physician(P0))</code></p>
  
  <p>SO I have another string variable <code>querypart</code> which stores the new word:</p>
  
  <p><code>managesa</code></p>
  
  <p>What I tried in the code was:</p>
  
  <pre><code>EDC = EDC.replaceAll(st,querypart);
  </code></pre>
  
  <p>but it did not work. </p>
  
  <p>I thought the problem might be paranthesis, so I changed the string like st variable like:</p>
  
  <p><code>manages\\(P0,MT0\\)</code></p>
  
  <p>then I tried </p>
  
  <pre><code>EDC = EDC.replaceAll(st,querypart);
  </code></pre>
  
  <p>but I had the some result. The problem is when I use the replaceAll like that:</p>
  
  <pre><code>EDC = EDC.replaceAll("manages\\(P0,MT0\\)",querypart);
  </code></pre>
  
  <p>The sentence changes </p>
  
  <p><code>query(MT0, P0) :- not(managesa), ins_manages(P0,MT0), not(physician(P0)), not(ins_physician(P0))</code></p>
  
  <p>I guess it is because of parenthesis but I could not find any solution for that? What is the solution?</p>