Isskint
Slowly Developing
- Local time
- Today, 22:26
- Joined
- Apr 25, 2012
- Messages
- 1,302
Hey gang 
I am looking for a way to check a string for gibberish. So aaaaaa, bbbbb, lsdjadjlajdkljas etc is not allowed.
Now i have done this thus far for aaa bbb etc by using INSTR() through a loop through an array, but obviously you need to anticipate EVERY conceivable piece of gibberish.
Is this achievable, perhaps pattern matching with VBScript.RegExp OR assigning a value to identify consecutive/repeated letters from the keyboard?

I am looking for a way to check a string for gibberish. So aaaaaa, bbbbb, lsdjadjlajdkljas etc is not allowed.
Now i have done this thus far for aaa bbb etc by using INSTR() through a loop through an array, but obviously you need to anticipate EVERY conceivable piece of gibberish.
Code:
Public Function ValidString(Phrase As String) As Boolean
Dim strValid As String
Dim strArray() As String
strArray = Split("aaa|bbb|ccc|ddd|eee|fff|ggg|hhh|iii|jjj|kkk|lll|mmm|nnn|ooo|ppp|qqq|rrr|sss|ttt|uuu|vvv|www|xxx|yyy|zzz", "|")
ValidString = True
For Each Gibberish In strArray
If InStr(Phrase, Gibberish) <> 0 Then ValidString = False
Next Gibberish
End Function
Is this achievable, perhaps pattern matching with VBScript.RegExp OR assigning a value to identify consecutive/repeated letters from the keyboard?