源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

VBS教程:VBscript属性-Value 属性

  • 时间:2020-01-01 08:19 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:VBS教程:VBscript属性-Value 属性

Value 属性

返回在一个搜索字符串中找到的匹配的值或文本。 [code][i]object[/i].[b]Value[/b][/code] [i]object[/i] 参数总是一个 [b]Match[/b] 对象。 [h3]说明[/h3]下列代码说明了 [b]Value[/b] 属性的用法:
[code]Function RegExpTest(patrn, strng)  Dim regEx, Match, Matches         ' [/code]建立变量。[code]  Set regEx = New RegExp         ' [/code]建立正则表达式。[code]  regEx.Pattern = patrn         ' [/code]设置模式。[code]  regEx.IgnoreCase = True         ' [/code]设置是否区分字母的大小写。[code]  regEx.Global = True            ' [/code]设置全程可用性。[code]  Set Matches = regEx.Execute(strng)      ' [/code]执行搜索。[code]  For Each Match in Matches         ' [/code]遍历[code]Matches[/code]集合。[code]    RetStr = RetStr & "Match " & I & " found at position "[/code][code]    RetStr = RetStr & Match.FirstIndex & ". Match Value is "'[/code][code]    RetStr = RetStr & [b]Match.Value[/b] & "'." & vbCRLF[/code][code]  Next[/code][code]  RegExpTest = RetStr[/code][code]End Function[/code][code]MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))[/code]
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部