Value 属性
返回在一个搜索字符串中找到的匹配的值或文本。
object.Value
object 参数总是一个 Match 对象。
说明
下列代码说明了 Value 属性的用法:
复制代码
1Function RegExpTest(patrn, strng) Dim regEx, Match, Matches '
建立变量。Set regEx = New RegExp '
建立正则表达式。regEx.Pattern = patrn '
设置模式。regEx.IgnoreCase = True '
设置是否区分字母的大小写。regEx.Global = True '
设置全程可用性。Set Matches = regEx.Execute(strng) '
执行搜索。For Each Match in Matches '
遍历Matches
集合。RetStr = RetStr & "Match " & I & " found at position "
RetStr = RetStr & Match.FirstIndex & ". Match Value is "'
RetStr = RetStr & Match.Value & "'." & vbCRLF
Next
RegExpTest = RetStr
End Function
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))
最后
以上就是聪明黄豆最近收集整理的关于VBS教程:VBscript属性-Value 属性的全部内容,更多相关VBS教程:VBscript属性-Value内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复