开发者

Regular Expression working in .Net but not in Classic ASP

I have the below regular expression which is working fine in .NET however it is not working in Classic ASP. The Regular expression is used to validate for a least one digit and one character.

The expression is:

Set regPassword = New R开发者_开发百科egExp
regPassword.Pattern = "^(?=.*\d)(?=.*[A-Za-z]).{6,30}$"
Response.Write(regPassword.Test("Test456"))

The result of the above returns False.

Does anyone know a workaround for this?


 ^.(?=.*\d)(?=.*[A-Za-z]){6,30}

Here is a good resource on the VBScript Regex engine.

Edit: According to the comments, this works?

(.*[a-zA-Z].*[0-9]|.*[0-9].*[a-zA-Z])
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜