emulate case-conversion of replace-regexp.