title: How to replace these characters "[" and "]" using regex?
body: <p>I have a string like this</p>
  
  <pre><code>String myString = "I love [stackoverflow]";
  </code></pre>
  
  <p>What I want to do is to replace the character <code>"["</code> to <code>&lt;span style="color:red;"&gt;</code> and the character <code>"]"</code> to <code>&lt;/span&gt;</code> to change the color of
  the word <code>stackoverflow</code> to red.</p>
  
  <p>So the expected string result is <code>"I love &lt;span style="color:red;"&gt;stackoverflow&lt;/span&gt;"</code></p>
  
  <p>I am new in regex so I tried like this</p>
  
  <pre><code>String myString = "I love [Stackoverflow]";
  
  myString.replaceAll("[",&lt;span style="color:red;"&gt;).replaceAll("]","&lt;/span&gt;");
  </code></pre>
  
  <p>but seems not the correct way because the android studio says </p>
  
  <blockquote>
    <p>unclosed character class</p>
  </blockquote>
  
  <p>What is the correct regex of that single character?</p>