VBScript正则表达式..docVIP

  • 11
  • 0
  • 约1.42万字
  • 约 21页
  • 2017-01-12 发布于重庆
  • 举报
VBScript正则表达式.

正则表达式(RegExp)对象 提供简单的正则表达式支持功能。 下面的代码说明了RegExp对象的用法:Function 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?????? 遍历匹配集合。 RetStr = RetStr Match found at position RetStr = RetStr Match.FirstIndex . Match Value is RetStr = RetStr Match.Value . vbCRLF Next RegExpTest = RetStr End Function MsgBox(RegExpTest(is., IS1

文档评论(0)

1亿VIP精品文档

相关文档