title: Javascript replace with regular expression not working in IE 11
body: <p>I'm having some javascript issues with some legacy code, since my company is attempting to upgrade to IE11 from IE8. I have a piece of javascript that finds all commas in a field and replaces it with a couple characters, it is as follows:</p>
  
  <pre><code>document.frm.txt_fieldValue[1].value = 
  document.frm.txt_fieldValue[1].value.replace(/,/gi, "$0");
  </code></pre>
  
  <p>In my code this is all on one line, however. This code works in IE8, Chrome, and Firefox. However, in IE9+, specifically IE11 (since this is what my company is upgrading to), this code doesn't replace any commas. I can get it to replace a single comma by using the following code: </p>
  
  <pre><code>document.frm.txt_fieldValue[1].value = 
  document.frm.txt_fieldValue[1].value.replace(",", "$0");
  </code></pre>
  
  <p>Because I replaced a single comma, I know my code is reached. But I have searched around and I have yet to find a solid answer. Does anyone else have this problem? If so, has anyone found a solution?</p>
  
  <p>Thanks!</p>