LOoking at like for like:
Function IsLike(Value, Pattern)
Dim regEx
Set regEx = CreateObject("vbscript.regexp")
With regEx
.Global = True
.IgnoreCase = True
.Pattern = "^" & Replace(Pattern, "*", ".{0,}") & "$"
IsLike = .Test(Value)
End With
Set regEx = Nothing
End Function
Will accept control codes between the strings whereas
Function IsLike(ByVal TextVal, ByVal Pattern)
Dim RXP
IsLike = False
Set RXP = New RegExp
With RXP
.Global = True
.IgnoreCase = True
.Pattern = "^" & Replace(Pattern, "*", "[\x20-\x7E]*") & "$"
IsLike = .Test(TextVal)
End With
Set RXP = Nothing
End Function
WIll ensure the only characters between the components are alphanumerics and common punctuation.
Chris