correctly escape end of line char in rules