How to get the matched string
|
Hi Mustak,
aqString.StrMatches doesn't capture matches. You need to use the language's native regular expressions for that. For example, in VBScript, you need to use the RegExp.Execute method.
Sub Test
Dim sString, re, colMatches
sString = "Test String:Whats going on"
Set re = New RegExp
re.Pattern = "go.*g"
Set colMatches = re.Execute(sString)
If colMatches.Count > 0 Then
Log.Message colMatches(0).Value
Else
Log.Message "Match not found"
End If
End Sub