anchor.diff:       end;
       finally
        SetLength(LocalMultiCaptures,0);
  +    end;
  +   end;
  +  except
  +   on e:Exception do begin
  +    if assigned(Error) then begin
  +     s:=AnsiString(e.Message);
  +     Len:=length(s);
  +     if Len>0 then begin
  +      GetMem(Error^,(Len+1)*SizeOf(AnsiChar));
  +      Move(s[1],Error^[0],Len);
  +      Error^[Len]:=#0;
  +     end else begin
  +      Error^:=nil;
  +     end;
  +     s:='';
  +    end;
  +    result:=0;
  +   end;
  +  end;
  + end;
  +end;
  +
  +function FLREReplaceAll(const Instance:pointer;const Input:pointer;const InputLength:longint;const Replacement:pointer;const ReplacementLength:longint;const ResultString:PPointer;const ResultStringLength:PLongint;const StartPosition,Limit:longint;const Error:PPAnsiChar):longint;
  +var s:ansistring;
  +    Len,Index,SubIndex:longint;
  +    p:plongint;
  +begin
  + result:=0;
  + if assigned(Error) and assigned(Error^) then begin
  +  FreeMem(Error^);
  +  Error^:=nil;
  + end;
  + if assigned(ResultString) and assigned(ResultString^) then begin
  +  FreeMem(ResultString^);
  +  ResultString^:=nil;
  + end;
  + if assigned(Instance) then begin
  +  try
  +   if assigned(ResultString) then begin
  +    s:='';
  +    try
  +     s:=TFLRE(Instance).PtrReplaceAll(Input,InputLength,Replacement,ReplacementLength,StartPosition,Limit);
  +     Len:=length(s);
  +     if Len>0 then begin
  +      GetMem(ResultString^,(Len+1)*SizeOf(AnsiChar));
  +      Move(s[1],PAnsiChar(ResultString^)[0],Len);
  +      PAnsiChar(ResultString^)[Len]:=#0;
  +     end else begin
  +      ResultString^:=nil;
  +     end;
  +     if assigned(ResultStringLength) then begin
  +      ResultStringLength^:=Len;
  +     end;
  +     result:=1;
  +    finally
  +     s:='';
       end;
      end;
     except
  
positive.code:              e:=-1;
               inc(i);
               j:=i;
               while i<AReplacementLength do begin
                if PAnsiChar(AReplacement)[i] in ['a'..'z','A'..'Z','_','0'..'9'] then begin
                 inc(i);
                end else begin
                 break;
                end;
               end;
               if j<i then begin
                e:=NamedGroupStringIntegerPairHashMap.GetValue(PtrCopy(PAnsiChar(AReplacement),j,i-j));
               end;
               if e<0 then begin
                result:=result+cc+'g';
  
negative.code:  result:='';
   Captures:=nil;
   try                       
    SimpleReplacement:=(PtrPosChar('$',Replacement,ReplacementLength)<0) and (PtrPosChar('\',Replacement,ReplacementLength)<0);
    CurrentPosition:=StartPosition;
    LastPosition:=CurrentPosition;
    if CurrentPosition>=0 then begin
  