You are on page 1of 1

Private Function IsValidPassword(ByVal pass As String) As Boolean Dim pattern As String = "^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[ @#$%^&+=]).*$" Dim regex As New System.Text.RegularExpressions.

Regex(pattern) Return regex.IsMatch(pass) End Function

tompol perintah : If IsValidPassword(txtPassword.Text) = False Then MessageBox.Show("Password tidak valid!!") Else MessageBox.Show("Password valid!!") End If

You might also like