How do you replace in rich text while preserving formatting?

Both the Substitute and RegexReplace function removes the formatting. While other functions such as Concatenate preserves the formatting. Is there a version of replace that allows formatting to be preserved?