2012-09-06 14 views
5

mój wynik regex w VBA (WORD) daje tylko jeden wynik.vba regex zwraca tylko pierwszy mecz

Stworzyłem tę funkcję

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 

Problem polega na tym, że daje tylko pierwszy wynik. Na przykład mam ciąg znaków:

[step 1] title for substeps; [substep a] step a; [substep b] step b; [substep c] step c; 

mój wynik jest:

[podetap a] etap a;

tylko 1 mecz, a nie etap b i c.

Odpowiedz