Hi
I've got my RegExp set up as below - Password and email seem ok but Postcode doesn't seem to work
it will allow
CH1 2HSSSSSSSSSSSSSSSSSSSS
won't allow
CH1 2HS (which is valid)
any ideas ?
thanks
kim
Dim valid_str
Dim oRegExp
Set oRegExp = New RegExp
oRegExp.IgnoreCase = False
oRegExp.pattern = valid_str
Dim matches, match
Set matches = oRegExp.Execute(Password)
For Each match in matches
If len(Password) < 8 Or len(Password) > 15 Then
ErrorMsg1 = ErrorMsg1 & "Password length must be between 8-15 characters<br>"
Else
oRegExp.pattern = "([^a-z0-9])"
If oRegExp.Test(Password) Then
ErrorMsg1 = ErrorMsg1 & "Password contains invalid characters<br>"
Else
oRegExp.pattern = "(^[^a-z]+$)|(^[^0-9]+$)"
If oRegExp.Test(Password) Then
ErrorMsg1 = ErrorMsg1 & "Password must contain at least one lowercase letter, and one number<br>"
Else
end if
End If
End If
Next
Dim valid_str1
valid_str1 = "^[\w-_\.]+\@[\w-_]+(\.[\w-_]+)+$"
Dim oRegExp1
Set oRegExp1 = New RegExp
oRegExp1.pattern = valid_str1
If not oRegExp1.Test(EmailAddr) Then
ErrorMsg1 = ErrorMsg1 & "Email format must be in host@domain.com format<br>"
Else
End If
Dim valid_str2
valid_str2 = "^[A-Z]{1,2}[1-9][0-9]{0,1}[1-9][ABD-HJLNP-UW-Z]{2}$"
Dim oRegExp2
Set oRegExp2 = New RegExp
oRegExp2.pattern = valid_str2
If not oRegExp2.Test(PostCode) Then
ErrorMsg1 = ErrorMsg1 & "Postcode must be in UK format<br>"
Else
I've got my RegExp set up as below - Password and email seem ok but Postcode doesn't seem to work
it will allow
CH1 2HSSSSSSSSSSSSSSSSSSSS
won't allow
CH1 2HS (which is valid)
any ideas ?
thanks
kim
Dim valid_str
Dim oRegExp
Set oRegExp = New RegExp
oRegExp.IgnoreCase = False
oRegExp.pattern = valid_str
Dim matches, match
Set matches = oRegExp.Execute(Password)
For Each match in matches
If len(Password) < 8 Or len(Password) > 15 Then
ErrorMsg1 = ErrorMsg1 & "Password length must be between 8-15 characters<br>"
Else
oRegExp.pattern = "([^a-z0-9])"
If oRegExp.Test(Password) Then
ErrorMsg1 = ErrorMsg1 & "Password contains invalid characters<br>"
Else
oRegExp.pattern = "(^[^a-z]+$)|(^[^0-9]+$)"
If oRegExp.Test(Password) Then
ErrorMsg1 = ErrorMsg1 & "Password must contain at least one lowercase letter, and one number<br>"
Else
end if
End If
End If
Next
Dim valid_str1
valid_str1 = "^[\w-_\.]+\@[\w-_]+(\.[\w-_]+)+$"
Dim oRegExp1
Set oRegExp1 = New RegExp
oRegExp1.pattern = valid_str1
If not oRegExp1.Test(EmailAddr) Then
ErrorMsg1 = ErrorMsg1 & "Email format must be in host@domain.com format<br>"
Else
End If
Dim valid_str2
valid_str2 = "^[A-Z]{1,2}[1-9][0-9]{0,1}[1-9][ABD-HJLNP-UW-Z]{2}$"
Dim oRegExp2
Set oRegExp2 = New RegExp
oRegExp2.pattern = valid_str2
If not oRegExp2.Test(PostCode) Then
ErrorMsg1 = ErrorMsg1 & "Postcode must be in UK format<br>"
Else