IE7 regex issue - Regex that work in every browser does not work in ie7

前端 未结 1 522
一向
一向 2021-01-19 15:49

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(         


        
相关标签:
1条回答
  • 2021-01-19 16:24

    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:

    • http://development.thatoneplace.net/2008/05/bug-discovered-in-internet-explorer-7.html
    • http://blog.stevenlevithan.com/archives/regex-lookahead-bug
    • http://forums.asp.net/p/1405215/3056174.aspx
    0 讨论(0)
提交回复
热议问题