Table of Contents

Interface IStdMatchCollectionClass

Namespace
RDCore.SDK.Runtime.Abstract.StdLib
Assembly
RDCore.SDK.dll

RD-VBAL §6.2 VBScript Regular Expressions: the MatchCollection class, the matches RegExp.Execute found.

[StdLibClass(null, IsCreatable = false)]
public interface IStdMatchCollectionClass

Remarks

Its members are numbered from 0. Item(VBLongValue) is the default member of the class, so m(0) is m.Item(0), and a For Each over it enumerates the matches in the order they are in the text. Only RegExp.Execute makes one.

Methods

Count()

Gets how many matches there are.

[StdLibMember(null, Kind = StdLibMemberKind.PropertyGet)]
RuntimeSemanticsEvaluationResult<VBLongValue> Count()

Returns

RuntimeSemanticsEvaluationResult<VBLongValue>

A RuntimeSemanticsEvaluationResult object encapsulating the result of the successful operation, or the error metadata otherwise.

Item(VBLongValue)

Gets a match by its position.

[StdLibMember(null, Kind = StdLibMemberKind.PropertyGet, UserMemId = 0)]
RuntimeSemanticsEvaluationResult<VBObjectValue> Item(VBLongValue index)

Parameters

index VBLongValue

From 0 to Count - 1.
💥InvalidProcedureCallOrArgument for any other.

Returns

RuntimeSemanticsEvaluationResult<VBObjectValue>

A RuntimeSemanticsEvaluationResult whose value is a Match (IStdMatchClass).

Remarks

It is declared Object, as the library's own type library declares it (IDispatch): m(0).SubMatches(Null) is a late-bound call whatever m is declared as, a type mismatch where an early-bound one is error 94 (MS-VBA, recorded in Excel).

NewEnum()

Returns the object that enumerates the matches: what a For Each over them drives.

[StdLibMember("_NewEnum", ReturnType = typeof(IStdEnumVariantClass), IsHidden = true, UserMemId = -4)]
RuntimeSemanticsEvaluationResult<VBObjectValue> NewEnum()

Returns

RuntimeSemanticsEvaluationResult<VBObjectValue>

A RuntimeSemanticsEvaluationResult whose value is an object of the IEnumVARIANT class (IStdEnumVariantClass).