Replace all string occurences
<p>I want to replace all the occurrences of <code>[h2][/h2]</code> in a JavaScript string
For example, I have</p>

<pre><code>var mystring = 'hii[h2][/h2]';
</code></pre>

<p>I want to get -> hii</p>

<p>so far I tried</p>

<pre><code>mystring.replace(/[h2][\/h2]/g, "");
</code></pre>
