^$ matched twice #66

Open
opened 2021-05-08 14:00:20 +00:00 by benibela · 0 comments
benibela commented 2021-05-08 14:00:20 +00:00 (Migrated from github.com)

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

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
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BeRo1985/flre#66
No description provided.