Sideway BICK BlogSideway BICK BLOG from Sideway

A Sideway to Sideway Home

Link:http://output.to/sideway/default.asp?qno=180500019

Script, Scripting Language, VBScript elements, Server-Side VBScript Object Element Collection

VBScript Object Collections

Some typical predefined Elements are.

  • RegExp Object:
    • Execute Method
      • Matches Collection
        • Match Object
          • SubMatches Collection

Matches Collection

last updated 12/11/2017

is to prvide access to all matches returned by a regular expression search per a pattern as a single object.

Syntax

Set rematcolvar=reobjvar.Execute(string)

Argument

SetRequired. to specify the setting of an Object instance reference.rematcolvarRequired. to specify the name of the new Object instance reference.reobjvarRequired. The variable name of the associated Object instantance.ExecuteRequired Method Keyword. To specify the Execute Execute of an RegExp Object.stringOptional. Regular string expression being searched for. May include any predefined regular expression characters for setting..Required. The dot notation used to access the Property of an object.=Required. required as assigning equal to operator for setting the value of Pattern to searchstring.

Remarks

  • A Matches Collection can be only created using the Execute Method of the RegExp Object.
  • A Matches Collection contains individual Match Objects that are matched returned per specified Pattern by the Execute Method of RegExp Object.
  • The Count property of the Matches collection is read-only, as are the individual Match object properties.
  • When a regular expression is executed, zero or more Match objects can result. Each Match object provides access to the string found by the regular expression, the length of the string, and an index to where the match was found.
  • Collection of regular expression Match objects returned from the Execute Method of RegExp Object. In other words, a collection of matched items per speicifed pattern.

Requirement

5

SubMatches Collection

last updated 12/12/2017

is to provide access to all submatches inside a match returned by a regular expression search as a single object.

Syntax

Set rematobjvar=reobjvar.Execute(string).Item(key)
Set resubmatcolvar=rematobjvar.SubMatches

Remarks

  • A SubMatches collection contains individual submatch strings, and can only be created using the Execute method of the RegExp object. The SubMatches collection's properties are read-only When a regular expression is executed, zero or more submatches can result when subexpressions are enclosed in capturing parentheses. Each item in the SubMatches collection is the string found and captured by the regular expression. The following code illustrates how to obtain a SubMatches collection from a regular expression search and how to access its individual members:

Requirement

5.5

Sideway BICK Blog

19/05


Copyright © 2000-2020 Sideway . All rights reserved Disclaimerslast modified on 26 January 2013