System.RegularExpressionsCore.TPerlRegEx.Groups

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Groups[Index: Integer]: string read GetGroups;

C++

__property System::UnicodeString Groups[int Index] = {read=GetGroups};

Properties

Type Visibility Source Unit Parent
property public
System.RegularExpressionsCore.pas
System.RegularExpressionsCore.hpp
System.RegularExpressionsCore TPerlRegEx

Description

Matched groups after a regex has been matched.

Groups[0] = MatchedText

The item count in the Groups array increases with one for every opening bracket in the regex. The text matched by the part of the regex between that opening bracket and its corresponding closing bracket, will be put in the Groups array.

Valid range for Index is 0..GroupCount. Note that GroupCount need not be equal to the number of opening brackets, since it may happen that only part of the regular expression played a role in the current match.

If you used named capturing groups in the regular expressions, use the NamedGroup method to retrieve the index number of a named group.

Run-time and read-only.

See Also

Code Examples