Interface IStdSubMatchesClass
RD-VBAL §6.2 VBScript Regular Expressions: the SubMatches class, what each group of a pattern matched in one match.
[StdLibClass(null, IsCreatable = false)]
public interface IStdSubMatchesClass
Remarks
There is one member for each group of the pattern, in the order of their opening parentheses, numbered from 0: the text the group matched, which
can be empty, or Empty for a group that took no part in the match ((a)|(b) matching "b"). A group inside a repetition is what it
matched last. Item(VBLongValue) is the default member of the class. Only a Match makes one.
Methods
Count()
Gets how many groups the pattern has.
[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 what a group matched, by its position.
[StdLibMember(null, Kind = StdLibMemberKind.PropertyGet, UserMemId = 0)]
RuntimeSemanticsEvaluationResult<VBVariantValue> Item(VBLongValue index)
Parameters
indexVBLongValueFrom
0toCount - 1.
💥InvalidProcedureCallOrArgument for any other.
Returns
- RuntimeSemanticsEvaluationResult<VBVariantValue>
A RuntimeSemanticsEvaluationResult whose value is a
String, orEmptyfor a group that took no part in the match.
NewEnum()
Returns the object that enumerates what the groups matched: 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
IEnumVARIANTclass (IStdEnumVariantClass).