• 企业400电话
  • 微网小程序
  • AI电话机器人
  • 电商代运营
  • 全 部 栏 目

    企业400电话 网络优化推广 AI电话机器人 呼叫中心 网站建设 商标✡知产 微网小程序 电商运营 彩铃•短信 增值拓展业务
    asp match正则函数使用Matchs实例


      说明   
      Match   对象只能通过   RegExp   对象的   Execute   方法来创建,该方法实际上返回了   Match   对象的集合。所有的   Match   对象属性都是只读的。   
      在执行正则表达式时,可能产生零个或多个   Match   对象。每个   Match   对象提供了被正则表达式搜索找到的字符串的访问、字符串的长度,以及找到匹配的索引位置等。   

      下面的代码说明了   Match   对象的用法:     

      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 '   遍历   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"))  
    上一篇:ASP正则函数替换分页后的参数
    下一篇:asp 图片正则 替换,替换前检查图片是不是本地地址的方法
  • 相关文章
  • 

    © 2016-2020 巨人网络通讯

    时间:9:00-21:00 (节假日不休)

    地址:江苏信息产业基地11号楼四层

    《增值电信业务经营许可证》 苏B2-20120278

    asp match正则函数使用Matchs实例 asp,match,正则,函数,使用,