Do replacement according to one rule.