procedure TForm1.Button1Click(Sender: TObject);
begin
with RichEdit1 do begin
Lines.Text := 'The quick brown fox jumps right over the lazy dog';
SelStart := Pos ( 'brown', Lines.Text ) - 1;
SelLength := Length( 'brown' );
SelAttributes.Color := clAqua;
end;
end;