anchor.diff:       end;
        if CountMultiCaptures>=length(MultiCaptures) then begin
         SetLength(MultiCaptures,(CountMultiCaptures+1)*2);
  +      for Index:=CountMultiCaptures to length(MultiCaptures)-1 do begin
  +       SetLength(MultiCaptures[Index],Count);
  +      end;
        end;
        if rfMULTIMATCH in Flags then begin
  -      SetLength(MatchResult,CountMultiSubMatches+1);
         for Index:=0 to CountMultiSubMatches-1 do begin
          MatchResult[Index+1].Start:=Index;
          if ThreadLocalStorageInstance.MultiSubMatches[Index]>=0 then begin
  
positive.code:  end;
  
   if TrySearch(StartInstruction,Position) then begin
    SetLength(Captures,Instance.CountCaptures);
    for Counter:=0 to Instance.CountCaptures-1 do begin
     Index:=Instance.CapturesToSubMatchesMap[Counter] shl 1;
     Captures[Counter].Start:=MatchSubMatches[Index];
  
negative.code:    for Index:=0 to CountMultiSubMatches-1 do begin
      ThreadLocalStorageInstance.MultiSubMatches[Index]:=-1;
     end;
     Count:=CountMultiSubMatches+1;
    end else begin
     Count:=CountCaptures;
    end;
    SetLength(Captures,Count);
    result:=SearchMatch(ThreadLocalStorageInstance,Captures,StartPosition,InputLength,false);
    if result and (rfMULTIMATCH in Flags) then begin
     for Index:=0 to CountMultiSubMatches-1 do begin
      Captures[Index+1].Start:=Index;
      if ThreadLocalStorageInstance.MultiSubMatches[Index]>=0 then begin
  