views:

31

answers:

1

I have a regex validating a password value to be > 6 < 25 characters with at least one number.

var passwordRegEx = /^(?=.*\d)(?=.*[a-zA-Z]).{6,25}$/;
if(!#quickRegister_Password').val().test(pass))
{
   errorMgs += 'Your password must be at least 6 characters and have at least 1 number and 1 letter.\r\n';
}

It works in Firefox, Chrome, IE8 (IE7 ran from compatability in IE8) but not IE7 standalone.

+1  A: 

I think you have run into the regular expression lookahead bug in IE7's javascript engine.

Run the tests on this page and see if your results match up; you will probably see the lookahead tests fail: http://www.javascriptjedi.com/regex/tests/

Information:

birryree