計算一個字符串在另一字符串中出現的次數函數
Functionstrnum(patrn,strng)
DimregEx,Match,Matches,xx
xx=0
SetregEx=NewRegExp
regEx.Pattern=patrn
regEx.IgnoreCase=True'設置是否區分大小寫。
regEx.Global=True
SetMatches=regEx.Execute(strng)
ForEachMatchinMatches
xx=xx+1
Next
strnum=xx
EndFunction
新聞熱點
疑難解答