BeRo1985 / flre

FLRE - Fast Light Regular Expressions - A fast light regular expression library
GNU Lesser General Public License v2.1
94 stars 23 forks source link

^$ matched twice #66

Open benibela opened 3 years ago

benibela commented 3 years ago

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);

7 0 is found twice