正则表达式常用来作输入校验,本次使用的校验是 密码必须包含数字0-9、大小写英文字母、长度超过8位。
Dim reg As New RegExp
With reg
.Global = True
.IgnoreCase = True
.IgnoreCase= false'表达式区分大小写
.Pattern= "^(?=.{8,}?)(?=.*\d+)(?=.*[a-z]+)(?=.*[A-Z]+).*$" '长度大于7
End With
Dim Flag1 As Boolean
Flag1 = reg.Test(Trim(Me.txt_UserPsw.Value))