support replacing contents at rules