visualbasic6, tutorial,

Visual Basic 6.0 Password Validation

Jai Jai Follow Aug 06, 2019 · 1 min read
Visual Basic 6.0 Password Validation
Share this

Password Validation vb 6.0

    Private Function ValidatePassword(ByVal sPass) As Boolean
Dim regEx
    Set regEx = CreateObject("vbscript.regexp")
    'At least 8 characters
    'At least 1 number
    'At least 1 lowercase letter
    'At least 1 uppercase letter
    'At least 1 special character. Special charaters include [email protected]#$%^&+=
    regEx.Pattern = "^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[[email protected]#$%^&+=]).*$"

    ValidatePassword = regEx.Test(sPass)
    Set regEx = Nothing
End Function

Private Sub Command1_Click()
    MsgBox "Valid = " & ValidatePassword(Text1.Text)
End Sub

Private Sub Form_Load()
Text1.Text = ""
End Sub


Join Newsletter
Get the latest news right in your inbox. We never spam!
Written by Jai Follow
Blogger, exploring new ideas and learning to code.