Name

Matches Collection Object

Description

The collection of zero or more Match objects returned by the RegExp object’s Execute method; each Match object allows you to identify and manipulate one of the strings found by the regular expression.

Createable

No.

Properties

The Matches collection object supports the following two properties:

Count

Data Type: Long

Indicates the number of objects in the collection. A value of zero indicates that the collection is empty. The property is read-only.

Item

Syntax: Matches.Item( index )

Data Type: Match object

Returns a particular Match object based on index, its ordinal position in the collection. Matches is a zero-based collection; that is, its first member is at ordinal position 0, while its last member is at ordinal position Matches.Count - 1.

Example

See the example for the Match object.

Get VBScript in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.