Private Sub Command1_Click()
Dim txt As String
txt ="11:Jan:2019 ""This is an Example!"""
Dim re1 As String
re1 =".*?"
Dim re2 As String
re2 ="(a)"
Dim re3 As String
re3 =".*?"
Dim re4 As String
re4 ="[a-z]"
Dim re5 As String
re5 =".*?"
Dim re6 As String
re6 ="[a-z]"
Dim re7 As String
re7 =".*?"
Dim re8 As String
re8 ="[a-z]"
Dim re9 As String
re9 =".*?"
Dim re10 As String
re10 ="([a-z])"
Dim r As New RegExp
r.Pattern = re1+re2+re3+re4+re5+re6+re7+re8+re9+re10
r.IgnoreCase = True
Dim m As MatchCollection
Set m = r.Execute(txt)
If m.Item(0).SubMatches.Count > 0 Then
Dim w1
w1=m.Item(0).SubMatches.Item(0)
Dim w2
w2=m.Item(0).SubMatches.Item(1)
MsgBox("("+w1+")"+"("+w2+")"+"")
End If
End Sub
|