How to extract text using regex in vb6
Dim MyText As String
MyText = "anything [*]textToExtract[*] anything"
Result Should Be :
textToExtract
How to extract text using regex in vb6
Dim MyText As String
MyText = "anything [*]textToExtract[*] anything"
Result Should Be :
textToExtract
Sub test()
Dim re As RegExp, m As MatchCollection
Set re = New RegExp
Dim MyText As String, extractedText As String
MyText = "anything textToExtract anything"
re.Pattern = "anything (.*) anything"
Set m = re.Execute(MyText)
extractedText = m(0).SubMatches(0)
End Sub