This finds three matches of ^$, but there are only two:
var
f: TFLRE;
matches: TFLREMultiStrings;
captures: TFLREMultiCaptures;
i: Integer;
begin
f := TFLRE.Create('^$', [rfMULTILINE]);
f.ExtractAll(LineEnding+'abcd'+LineEnding+LineEnding+'defg',matches) ;
f.MatchAll(LineEnding+'abcd'+LineEnding+LineEnding+'defg',captures) ;
writeln(length(matches), ' = ', length(captures));
for i := 0 to high(captures) do
writeln(captures[i][0].Start, ' ', captures[i][0].Length);
This finds three matches of
^$
, but there are only two:7 0
is found twice