页面导航: 首页网络编程正则表达式 → 正文内容

vbs:能算出一个字符在一字段里共出现有几次的函数

发布:dxy 字体:[增加 减小] 类型:转载
Function RegExpTest(patrn, strng) 
Dim regEx, Matches 
Set regEx = New RegExp 
regEx.Pattern = patrn 
regEx.IgnoreCase = True ‘为真则忽略大小写,否则严格匹配大小写 
regEx.Global = True 
Set Matches = regEx.Execute(strng) 
RegExpTest = Matches.count 
End Function 
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))  
浏览次数:载入中... 打印本文关闭本文返回首页

文章评论

共有 位脚本之家网友发表了评论我来说两句

同 类 文 章
最 近 更 新
热 点 排 行