Expand|Select|Wrap|Line Numbers
- im MyString, MyArray, i, objRegEx, array, stransw1, strquit, Firstname, Lastname, Password, aMyString
- stransw1 = true
- Do while stransw1 = true
- MyString = Inputbox("please tell me your Firstname: Lastname: Password: PLEASE PLACE A COMMA BETWEEN EACH")
- if Mystring = "" then
- strquit = msgbox ("Do you want to quit?", vbyesno)
- if strquit = vbyes then
- wscript.quit
- end if
- end if
- MyArray = Split (MyString, ",")
- if UBound(MyArray) = 2 then
- stransw1 = false
- Set RegEx = New RegExp 'create regular expression.
- RegEx.pattern = "^([a-zA-Z]+)$" 'set pattern.
- Set Matches = RegEx.Execute(MyArray(0)) 'execute the search
- if Matches.count = 0 then
- stransw1 = true
- Msgbox "First name can't contain special characters or numbers"
- end if
- Set RegEx = New RegExp
- RegEx.Pattern = "^([a-zA-Z]+)$"
- Set Matches = RegEx.Execute(MyArray(1))
- if Matches.count = 0 then
- stransw1 = true
- Msgbox "Last name can't contain special characters or numbers"
- end if
- Set RegEx = New RegExp
- RegEx.Pattern = "[A-Z]"
- Set Matches = RegEx.Execute(MyArray(2))
- if Matches.count = 0 then
- stransw1 = true
- Msgbox "Password must have Upper case letter"
- end if
- Set RegEx = New RegExp
- RegEx.Pattern = "[a-z]"