本ASP函数用来检测用户输入的密码是否符合规定,也就是是否符合带有下划线、字母有数字的格式,用来检测客户输入的密码是否合法可以。
Public Function CheckPassword(Str) Dim pass CheckPassword=true If Str <> "" Then Dim Rep Set Rep = New RegExp Rep.Global = True Rep.IgnoreCase = True '匹配字母、数字、下划线、点号 Rep.Pattern="[a-zA-Z0-9_\.]+$" Pass=rep.Test(Str) Set Rep=nothing If not Pass Then CheckPassword=false End If End Function
青岛星网温馨提醒:函数返回值:true无误,false有误。