anchor.diff:  
   procedure TFLRE.CompileByteMapForOnePassNFAAndDFA;
   var Node:PFLRENode;
  -    i,j,ByteCount:longint;
  +    i,ByteCount:longint;
  +    CurrentChar:ansichar;
       CharSetMap:TFLRECharClass;
  -    CharClass:TFLRECharClass;
  -    c:ansichar;
  -begin
  +    CharClass,NodeCharClass:TFLRECharClass;
  +    NewLines,Words:boolean;
  +begin
  + NewLines:=false;
  + Words:=false;
    FillChar(ByteMap,SizeOf(TFLREByteMap),#0);
    FillChar(UnByteMap,SizeOf(TFLREByteMap),#0);
    ByteCount:=0;
    CharSetMap:=[];
  + CharClass:=[];
    for i:=0 to Nodes.Count-1 do begin
     Node:=Nodes[i];
     if assigned(Node) then begin
      case Node^.NodeType of
  +    ntZEROWIDTH:begin
  +     if (Node^.Value and (sfEmptyBeginLine or sfEmptyEndLine))<>0 then begin
  +      NewLines:=true;
  +     end;
  +     if (Node^.Value and (sfEmptyWordBoundary or sfEmptyNonWordBoundary))<>0 then begin
  +      Words:=true;
  +     end;
  +    end;
       ntCHAR:begin
  -     CharClass:=GetCharClass(Node^.Value);
  -     if CharClass<>AllCharClass then begin
  -      for j:=0 to 255 do begin
  -       c:=ansichar(byte(j));
  -       if (c in CharClass) and not (c in CharSetMap) then begin
  -        System.Include(CharSetMap,c);
  -        ByteMap[byte(c)]:=ByteCount;
  -        UnByteMap[ByteCount]:=byte(c);
  -        inc(ByteCount);
  -       end;
  -      end;
  -     end;
  -    end;
  +     NodeCharClass:=GetCharClass(Node^.Value);
  +     if NodeCharClass<>AllCharClass then begin
  +      CharClass:=CharClass+NodeCharClass;
  +     end;
  +    end;
  +   end;
  +  end;
  + end;
  + if NewLines or Words then begin
  +  if NewLines then begin
  +   CharClass:=CharClass+[#$0a,#$0d];
  +   if rfUTF8 in Flags then begin
  +    CharClass:=CharClass+(([#$c2,#$85]{U+0085})+
  +                          ([#$e2,#$80,#$a8]{U+2028 LINE SEPARATOR})+
  +                          ([#$e2,#$80,#$a9]{U+2029 PARAGRAPH SEPARATOR}));
  +   end else begin
  +    CharClass:=CharClass+[#$85];
  +   end;
  +  end;
  +  if Words then begin
  +   CharClass:=CharClass+['a'..'z','A'..'Z','0'..'9','_'];
  +   if rfUTF8 in Flags then begin
  +    CharClass:=CharClass+[#$80..#$ff];
  +   end;
  +  end;
  + end;
  + if CharClass<>[] then begin
  +  for CurrentChar:=#0 to #255 do begin
  +   if (CurrentChar in CharClass) and not (CurrentChar in CharSetMap) then begin
  +    System.Include(CharSetMap,CurrentChar);
  +    ByteMap[byte(ansichar(CurrentChar))]:=ByteCount;
  +    UnByteMap[ByteCount]:=byte(ansichar(CurrentChar));
  +    inc(ByteCount);
      end;
     end;
    end;
    if ByteCount<256 then begin
  -  for i:=0 to 255 do begin
  -   if ansichar(byte(i)) in CharSetMap then begin
  -    inc(ByteMap[i]);
  +  for CurrentChar:=#0 to #255 do begin
  +   if CurrentChar in CharSetMap then begin
  +    inc(ByteMap[byte(ansichar(CurrentChar))]);
      end;
     end;
     inc(ByteCount);
  
positive.code:  BeginningWildCard:=false;
   BeginningAnchor:=false;
   EndingAnchor:=false;
  
   HasLookAssertions:=false;
   HasBackReferences:=false;
  
negative.code:   CurrentChar:=byte(ansichar(LocalInput[Position]));
    inc(Position);
    LastState:=State;
  //write(chr(CurrentChar),' ',LocalByteMap^[CurrentChar],' ');
    State:=State^.NextStates[LocalByteMap^[CurrentChar]];
    if not assigned(State) then begin
     State:=RunStateOnByte(LastState,Position-1,CurrentChar);
  