回复 4# fuinei
用删除法检测,如何?MsgBox(0, @error, _CkPw('A^sssad9'))
Func _CkPw($sP = '', $len = 6)
If StringLen($sP) < $len Then Return SetError(1, 0, 0)
Local $iCount = 0
If StringRegExp($sP, '[\W_]') Then $iCount += 1
$sP = StringRegExpReplace($sP, '[a-z]', '')
If Not @error And @extended Then $iCount += 1
$sP = StringRegExpReplace($sP, '[A-Z]', '')
If Not @error And @extended Then $iCount += 1
$sP = StringRegExpReplace($sP, '[0-9]', '')
If Not @error And @extended Then $iCount += 1
If $iCount >= 3 Then Return 1
Return SetError(2, 0, 0)
EndFunc ;==>_CkPw
|