my regex match in VBA (WORD) only gives one result.
I created this function
Function RE6(strData As String) As String
Dim RE As Object, REMatches As Object
Set RE = CreateObject("vbscript.regexp")
With RE
.MultiLine = False
.Global = False
.IgnoreCase = True
.Pattern = "\[substep [a-zA-Z]\](.*?); {1}"
End With
Set REMatches = RE.Execute(strData)
RE6 = ""
End Function
The problem here is that it only gives the first result. For example I got a string:
[step 1] title for substeps; [substep a] step a; [substep b] step b; [substep c] step c;
My result is:
[substep a] step a;
only 1 match, not the step b and c.
You need to set Global to True
http://msdn.microsoft.com/en-us/library/tdte5kwf%28v=vs.84%29
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With