anchor.diff:    SetLength(InstructionGenerations,Max(Instance.CountForwardInstructions,Instance.CountBackwardInstructions));
     for Index:=0 to length(InstructionGenerations)-1 do begin
      InstructionGenerations[Index]:=-1;
  -  end;
  -
  -  if Instance.DFAFast then begin
  -
  -   inc(Generation);
  -   GetMem(DFAState,StateSize);
  -   FillChar(DFAState^,StateSize,AnsiChar(#0));
  -   FastAddInstructionThread(DFAState,Instance.AnchoredStartInstruction);
  -   DFAState^.Flags:=DFAState^.Flags or sfDFAStart;
  -   StateCache.Add(DFAState);
  -   inc(CountStatesCached);
  -   DefaultStates[dskFastAnchored]:=DFAState;
  -
  -   inc(Generation);
  -   GetMem(DFAState,StateSize);
  -   FillChar(DFAState^,StateSize,AnsiChar(#0));
  -   FastAddInstructionThread(DFAState,Instance.UnanchoredStartInstruction);
  -   DFAState^.Flags:=DFAState^.Flags or sfDFAStart;
  -   StateCache.Add(DFAState);
  -   inc(CountStatesCached);
  -   DefaultStates[dskFastUnanchored]:=DFAState;
  -
  -   inc(Generation);
  -   GetMem(DFAState,StateSize);
  -   FillChar(DFAState^,StateSize,AnsiChar(#0));
  -   FastAddInstructionThread(DFAState,Instance.ReversedStartInstruction);
  -   DFAState^.Flags:=DFAState^.Flags or sfDFAStart;
  -   StateCache.Add(DFAState);
  -   inc(CountStatesCached);
  -   DefaultStates[dskFastReversed]:=DFAState;
  -
     end;
   
     inc(Generation);
  
positive.code: 
   // Connect the last state to the new state with the current char
   State.NextStates[Instance.ByteMap[CurrentChar]]:=result;
   
  end;
  
  function TFLREDFA.SearchMatchFull(const StartPosition,UntilExcludingPosition:longint;out MatchEnd:longint;const UnanchoredStart:boolean):longint;
  var Position,Start,PreviousPosition,LocalInputLength:longint;
      State,LastState:PFLREDFAState;
      StartState:PPFLREDFAState;
      StartInstruction:PFLREInstruction;
      LocalInput:pansichar;
      Flags,PreviousChar,CurrentChar:longword;
  begin
   result:=DFAFail;
  
   LocalInput:=ThreadLocalStorageInstance.Input;
   LocalInputLength:=ThreadLocalStorageInstance.InputLength;
  
   begin
    if (StartPosition>=0) and (StartPosition<ThreadLocalStorageInstance.InputLength) then begin
     if rfUTF8 in Instance.Flags then begin
      CurrentChar:=UTF8PtrCodeUnitGetCharFallback(LocalInput,ThreadLocalStorageInstance.InputLength,StartPosition);
  
negative.code:       sfDFAMatchWins=$1000;
        sfDFALastWord=$2000;
        sfDFADead=$4000;
        sfDFAFullMatch=$8000;
        sfDFANeedShift=16;
  
        // Default state kind
        dskDead=0;
        dskFullMatch=1;
        dskFastUnanchored=2;
        dskFastAnchored=3;
        dskFastReversed=4;
  
        // Start state kind
        sskUnanchored=0;
  