Global Replace with js
<p>I have the following string:</p>

<pre><code>[27564][85938][457438][273][48232]
</code></pre>

<p>I want to replace all the [ with ''.  I tried the following but it didn't work:</p>

<pre><code> var str = '[27564][85938][457438][273][48232]'
 var nChar = '[';
 var re = new RegExp(nChar, 'g')    
 var visList = str.replace(re,'');
</code></pre>

<p>what am I doing wrong here?</p>

<p>Many thanks in advance.</p>
