anchor.diff:             end else begin
               raise EFLRE.Create('Syntax error');
              end;
  -           Value:=CountParens;
  -           inc(CountParens);
  +           Value:=CountCaptures;
  +           inc(CountCaptures);
              NamedGroupStringIntegerPairHashMap.Add(Name,Value);
              if NamedGroupStringList.IndexOf(Name)<0 then begin
               NamedGroupStringList.Add(Name);
  
positive.code: begin
   inherited Create;
  
   CountParens:=0;
  
   AnchoredRootNode:=nil;
  
  
negative.code:  finally
    LocalLowRange:='';
    LocalHighRange:='';
   end;
  end;
  
  function FLREMatch(const Instance:pointer;const Input:pointer;const InputLength:longint;const Captures:PPointer;const CountCaptures:PLongint;const StartPosition:longint;const Error:PPAnsiChar):longint;
  type PLongints=^TLongints;
       TLongints=array[0..65535] of longint;
  var s:ansistring;
      Len,Index:longint;
      LocalCaptures:TFLRECaptures;
  begin
   result:=0;
   if assigned(Error) and assigned(Error^) then begin
    FreeMem(Error^);
    Error^:=nil;
   end;
   if assigned(Captures) and assigned(Captures^) then begin
    FreeMem(Captures^);
    Captures^:=nil;
   end;
   if assigned(Instance) then begin
    try
     if assigned(Captures) then begin
      LocalCaptures:=nil;
      try
       if TFLRE(Instance).PtrMatch(Input,InputLength,LocalCaptures,StartPosition) then begin
        GetMem(Captures^,length(LocalCaptures)*(sizeof(longint)*2));
        for Index:=0 to length(LocalCaptures)-1 do begin
         PLongints(Captures)^[(Index shl 1) or 0]:=LocalCaptures[Index].Start;
         PLongints(Captures)^[(Index shl 1) or 1]:=LocalCaptures[Index].Length;
        end;
        if assigned(CountCaptures) then begin
         CountCaptures^:=length(LocalCaptures);
        end;
        result:=1;
       end;
      finally
       SetLength(LocalCaptures,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 FLREMatchNext(const Instance:pointer;const Input:pointer;const InputLength:longint;const Captures:PPointer;const CountCaptures:PLongint;const StartPosition:longint;const Error:PPAnsiChar):longint;
  type PLongints=^TLongints;
       TLongints=array[0..65535] of longint;
  var s:ansistring;
      Len,Index:longint;
      LocalCaptures:TFLRECaptures;
  begin
   result:=0;
   if assigned(Error) and assigned(Error^) then begin
    FreeMem(Error^);
    Error^:=nil;
   end;
   if assigned(Captures) and assigned(Captures^) then begin
    FreeMem(Captures^);
    Captures^:=nil;
   end;
   if assigned(Instance) then begin
    try
     if assigned(Captures) then begin
      LocalCaptures:=nil;
      try
       if TFLRE(Instance).PtrMatchNext(Input,InputLength,LocalCaptures,StartPosition) then begin
        GetMem(Captures^,length(LocalCaptures)*(sizeof(longint)*2));
        for Index:=0 to length(LocalCaptures)-1 do begin
         PLongints(Captures)^[(Index shl 1) or 0]:=LocalCaptures[Index].Start;
         PLongints(Captures)^[(Index shl 1) or 1]:=LocalCaptures[Index].Length;
        end;
        if assigned(CountCaptures) then begin
         CountCaptures^:=length(LocalCaptures);
        end;
        result:=1;
       end;
      finally
       SetLength(LocalCaptures,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 FLREMatchAll(const Instance:pointer;const Input:pointer;const InputLength:longint;const MultiCaptures:PPointer;const CountMultiCaptures,CountCaptures:PLongint;const StartPosition,Limit:longint;const Error:PPAnsiChar):longint;
  var s:ansistring;
      Len,Index,SubIndex:longint;
      LocalMultiCaptures:TFLREMultiCaptures;
      p:plongint;
  begin
   result:=0;
   if assigned(Error) and assigned(Error^) then begin
    FreeMem(Error^);
    Error^:=nil;
   end;
   if assigned(MultiCaptures) and assigned(MultiCaptures^) then begin
    FreeMem(MultiCaptures^);
    MultiCaptures^:=nil;
   end;
   if assigned(Instance) then begin
    try
     if assigned(MultiCaptures) then begin
      LocalMultiCaptures:=nil;
      try
       if TFLRE(Instance).PtrMatchAll(Input,InputLength,LocalMultiCaptures,StartPosition,Limit) then begin
        GetMem(MultiCaptures^,length(LocalMultiCaptures)*TFLRE(Instance).CountCaptures*(sizeof(longint)*2));
        p:=MultiCaptures^;
        for Index:=0 to length(LocalMultiCaptures)-1 do begin
         for SubIndex:=0 to length(LocalMultiCaptures[Index])-1 do begin
          p^:=LocalMultiCaptures[Index,SubIndex].Start;
          inc(p);
          p^:=LocalMultiCaptures[Index,SubIndex].Length;
          inc(p);
         end;
        end;
        if assigned(CountMultiCaptures) then begin
         CountMultiCaptures^:=length(LocalMultiCaptures);
        end;
        if assigned(CountCaptures) then begin
         CountCaptures^:=TFLRE(Instance).CountCaptures;
        end;
        result:=1;
       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;
  
  