Simplify replace pattern.