Refine a diff substitution pattern.