anchor.diff:    found := False;
   
     //Cut all spaces
  -  while (pos + 1 < Length(aStr)) and (aStr[pos + 1] in SPACE_CHARS) do
  +  while (pos + 1 < Length(aStr)) and CharInSet(aStr[pos + 1], SPACE_CHARS) do
       Inc(pos);
   
     //Result is the position of the latest space after last non-space character
     for I := pos + 1 to Length(aStr) - 1 do
     begin
  -    if aStr[I] in SPACE_CHARS then
  +    if CharInSet(aStr[I], SPACE_CHARS) then
       begin
         Result := I;
         found := True;
  
positive.code: 
  
  const
    SPACE_CHARS: set of Char = [' ', '|'];
  
  //Get next word position in the given aStr, after cirtain position aPos
  //positions starts from 0
  
negative.code:   pos := aPos;
  
    //Cut all spaces
    while (pos >= 1) and CharInSet(aStr[pos], SPACE_CHARS) do
      Dec(pos);
  
    //Result is the first non-space character
    Result := pos;
    for I := pos downto 1 do
    begin
      if not CharInSet(aStr[I], SPACE_CHARS) then
        Result := I - 1
      else
        Break;
  