title: JavaScript  RegExp compatibility in IE
body: <pre><code>^(?=[\w\-%&amp;?#=]+\d)(?=[\w\-%&amp;?#=]+[a-zA-Z])[\w\-%&amp;?#=]{8,12}$
  </code></pre>
  
  <p>Was meant to match the below conditions in a JavaScript based new-password check,</p>
  
  <ul>
  <li>Must contain minimum 8 to 20 characters, mandatorily including one letter and number </li>
  <li>May include only one of the following special characters: %,&amp;, _, ?, #, =, -</li>
  <li>Cannot have any spaces</li>
  </ul>
  
  <p>With above regex, <code>goog123#</code> was matched in FF3.5. However this fails in IE6. Anyone knows what went wrong here? Is this a compatibility issue?</p>
  
  <p>JavaScript used to test the matching</p>
  
  <pre><code>function fnIsPassword(strInput)
  {
    alert("strInput : " + strInput);
    var regExp =/^(?=.{0,19}\d)(?=.{0,19}[a-zA-Z])[\w%&amp;?#=-]{8,20}$/;
    if(strInput.length &gt; 0){
       return (regExp.test(strInput));
    }
    return false;
  }
  alert(fnIsPassword("1231231")); //false 
  alert(fnIsPassword("sdfa4gggggg")); //FF: true, false in IE  
  alert(fnIsPassword("goog1234#")); //FF: true , false in IE 
  </code></pre>