title: Javascript Regex and Internet Explorer 8 misreading
body: <p>Hi all<br/>I'm trying to make some javascript Regex compatible with IE8. Below:<br/></p>
  
  <pre><code>/\/string\/.*(cod=[^]{4,5})\.[^]{1,3}($|&amp;)/
  /\/string\/.*(cod=[^]{4,5})($|&amp;)/
  </code></pre>
  
  <p>The first one was not parsed (expecting ' ] ' at the end) until I added brackets between 'cod=' and ' } '. Then it worked.<br/>Even very similar, the second Regex is still not working and IE8 seems to expect ' ) ' at the end of whatever. Why?<br/><br/>These expressions are then called as this:<br/></p>
  
  <pre><code>var Reg1 = new RegExp("\/string\/.*(cod=[^]{4,5})\.[^]{1,3}($|&amp;)");
  var Reg2 = new RegExp("\/string\/.*(cod=[^]{4,5})($|&amp;)");
  switch(true) {
    case Reg1.test(string):
      ...    
      break;
    case Reg2.test(string):
      ...    
      break;
  }
  </code></pre>
  
  <p>I must run the second Regex too.<br/>In case I'm thinking about some jQuery stuff if may help.<br/>Thanks for supporting.</p>