From SCAR Divi Manual
TRegexMatch = record MatchedText: AnsiString; Offset: Integer; Length: Integer; end;
SCAR Divi 3.25 > Current
A structured type which holds a regex match. MatchedText holds the text that was matched, Offset holds the offset where the match was found and finally Length holds the length of MatchedText.
var Matches: TRegexMatchArray; i: Integer; begin PregMatchEx('/World\! (\d+)/', 'Hello World! 125', Matches); for i := Low(Matches) to High(Matches) do WriteLn('"' + Matches[i].MatchedText + '" at ' + IntToStr(Matches[i].OffSet) + ' with length ' + IntToStr(Matches[i].Length)); end.
"World! 125" at 7 with length 10 "125" at 14 with length 3