With regExp
.Global = True
.MultiLine = True
.IgnoreCase = True
.Pattern = strRegExp End With
If (regExp.Test(strInput)) Then Set Matches = regExp.Execute(strInput) ReDim arrRes(0 To Matches.Count - 1) For Each Match In Matches
arrRes(i) = Match.value
i = i + 1 Next Match End If
GetMatchesWithRegExp = arrRes End Function
Può essere utilizzata in questo modo:
arrRes = GetMatchesWithRegExp(strInput, strRegExp) For Each Res In arrRes
... Next Res