VBScript のオブジェクトとコレクション、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 & "一致 " & I & " が、" RetStr = RetStr & Match.FirstIndex & " で見つかりました。一致した文字列は、" RetStr = RetStr & Match.Value & " です。" & vbCRLF Next RegExpTest = RetStr End Function MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))
「I」の部分変?