VBScript does have a regexp object. It's pretty weak, but it should be enough for this (not using my one-regexp solutions though ;-)
This is how it could be in VB. VBScript will be almost the same. I'll black this out so that the innocent Perl guys are not affected:
Private Function IsWeak(str As String) As Boolean
Dim re As VBScript_RegExp_55.RegExp
Set re = New VBScript_RegExp_55.RegExp
IsWeak = True
re.Pattern = "[a-z]"
If Not re.Test(str) Then Exit Function
re.Pattern = "[A-Z]"
If Not re.Test(str) Then Exit Function
re.Pattern = "[0-9]"
If Not re.Test(str) Then Exit Function
re.Pattern = "[;,.#!\$]"
If Not re.Test(str) Then Exit Function
IsWeak = False
End Function
|
Bleargh ......o...o.oo......oo.....oo...oooo..o..o.......
Jenda
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
-- Rick Osborne
Edit by castaway: Closed small tag in signature |