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