• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • QTP自動化測試之VBScript對象(5)

    發表于:2012-01-18來源:博客園作者:  known點擊數: 標簽:QTP自動化測試
    5. RegExp對象 RegExp是正則表達式對象,提供簡單的正則表達式支持功能。主要屬性有Global、IgnoreCase、Pattern,主要方法有Execute、Replace、Test,其屬性及方法的

      5. RegExp對象

      RegExp是正則表達式對象,提供簡單的正則表達式支持功能。主要屬性有Global、IgnoreCase、Pattern,主要方法有Execute、Replace、Test,其屬性及方法的詳細說明詳見參考文檔。下面的示例說明了RegExp對象的用法:

      ?

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    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 is2 IS3 is4"))

    原文轉自:http://www.kjueaiud.com

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>