Hello Gurus,
I need help translating some VBA language into simple English language. I have an idea what the output is but just need simple translation as to what is happening specifically. I know the code is looking for specific text. Thank ahead.
I need help translating some VBA language into simple English language. I have an idea what the output is but just need simple translation as to what is happening specifically. I know the code is looking for specific text. Thank ahead.
Code:
Dim regEx As Object
Dim allMatches As Object
Set regEx = CreateObject("vbscript.regexp")
regEx.Pattern = ("K\d{8}")
regEx.Global = True
regEx.ignorecase = True
Set allMatches = regEx.Execute(targetString)
If allMatches.Count > 0 Then
isKstring = True
Else
isKstring = False
End If
'clean up
Set regEx = Nothing
Set allMatches = Nothing
End Function
Public Function isCase(targetString As String) As Boolean
Dim regEx As Object
Dim allMatches As Object
Set regEx = CreateObject("vbscript.regexp")
Dim regEx2 As Object
Dim allMatches2 As Object
Set regEx2 = CreateObject("vbscript.regexp")
regEx.Pattern = ("case")
regEx.Global = True
regEx.ignorecase = True
regEx2.Pattern = ("no")
regEx2.Global = True
regEx2.ignorecase = True
Set allMatches = regEx.Execute(targetString)
Set allMatches2 = regEx2.Execute(targetString)
If allMatches.Count > 0 And allMatches2.Count > 0 Then
isCase = True
Else
isCase = False
End If
'clean up
Set regEx = Nothing
Set allMatches = Nothing
End Function
Public Function isCRTS(targetString As String) As Boolean
Dim regEx As Object
Dim allMatches As Object
Set regEx = CreateObject("vbscript.regexp")
regEx.Pattern = ("CRTS")
regEx.Global = True
regEx.ignorecase = True
Set allMatches = regEx.Execute(targetString)
If allMatches.Count > 0 Then
isCRTS = True
Else
isCRTS = False
End If
'clean up
Set regEx = Nothing
Set allMatches = Nothing
End Function
Last edited by a moderator: