我有一個模式,我發現一個匹配。我應該如何處理的情況下,其他的比賽我有多個選擇Vbs的正則表達式如何處理多個匹配
Dim re, targetString, colMatch, objMatch
Set re = New regexp
With re
.pattern = ">([\s,\S]*?)<"
.Global = True
.IgnoreCase = True
.Multiline = True
End With
targetString = ">test and test< >test2 and test2< >test3 and test3<"
Set colMatch = re.Execute(targetString)
For Each objMatch In colMatch
result = objMatch.SubMatches.Item(0)
Next
目前我只得到「TEST3和TEST3」,但我怎麼能得到其他人呢?
maybeWeCouldStealAVan,Thank you for your comment。您能否提供一個可行的示例 – Alex
@Alex您可以自己嘗試一下嗎? – Lankymart