Public Sub ExtractString()
Dim str As String
str = "Line 1." & vbCrLf
str = str & "Line 2 :" & vbCrLf
str = str & "Line 3 :" & vbCrLf
str = str & "Line 4:" & vbCrLf
str = str & "Line 5:" & vbCrLf
str = str & "Line 6:" & vbCrLf
str = str & "The End"
Dim reg As New regExp
reg.Pattern = "Line 4:\r(.*?)\rLine 6:"
reg.Global = True
reg.IgnoreCase = True
Dim Matches As MatchCollection
Set Matches = reg.Execute(str)
Dim strAnswer As String
strAnswer = reg.Execute(str)
End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.