Deuteronomy 23:7

23:7 You must not hate an Edomite, for he is your relative; you must not hate an Egyptian, for you lived as a foreigner in his land.

Deuteronomy 25:3

25:3 The judge may sentence him to forty blows, but no more. If he is struck with more than these, you might view your fellow Israelite with contempt.