title: Replace all instances of special character
body: <pre><code> var whatever = 'Some [b]random[/b] text in a [b]sentence.[/b]';
  </code></pre>
  
  <p>How can I replace every instance of <code>[b]</code> with <code>&lt;b&gt;</code> and every instance of <code>[/b]</code> with <code>&lt;/b&gt;</code> in jQuery?</p>
  
  <p>I was attempting to do it with regex but I couldn't get it to function properly.</p>