欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Visual Basic Scripting Edition  

正則表達(dá)式(RegExp)對(duì)象

提供簡(jiǎn)單的正則表達(dá)式支持功能。

說(shuō)明

下面的代碼說(shuō)明了RegExp對(duì)象的用法:

Function RegExpTest(patrn, strng)
   Dim regEx, Match, Matches   ' 建立變量。
   Set regEx = New RegExp   ' 建立正則表達(dá)式。
   regEx.Pattern = patrn   ' 設(shè)置模式。
   regEx.IgnoreCase = True   ' 設(shè)置是否區(qū)分字符大小寫。
   regEx.Global = True   ' 設(shè)置全局可用性。
   Set Matches = regEx.Execute(strng)   ' 執(zhí)行搜索。
   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"))

屬性和方法

正則表達(dá)式對(duì)象的屬性和方法

要求

版本 5

請(qǐng)參閱

Match 對(duì)象 | Matches 集合