I need the group values instead of the matches. This is how i tried to get those:
Dim item as Variant, matches As Object, match As Object, subMatch As Variant, subMatches(), row As integer
row = 1
For Each item In arr
With regex
.Pattern = "\bopenfile ([^\s]+)|\bopen file ([^\s]+)"
Set matches = regex.Execute(item)
For Each match In matches
For Each subMatch In match.subMatches
subMatches(i) = match.subMatches(i)
ActiveSheet.Range("A" & row).Value = subMatches(i)
row = row + 1
i = i + 1
Next subMatch
Next match
End With
Next item
This is the text from where it should be extracted:
Some help would be great :)
Open File file.M_p3_23432e done
Openfile file.M_p4_6432e done
Open File file.M_p3_857432 done
Open File file.M_p4_34892f done
Openfile file.M_p3_781 done
Info: I'm using Excel VBA.. If that is important to know.