Regexreplace multiple strings in a loop with FORMATTING?

Oh, I remember pulling this off quite a while ago. Of course I wouldn’t find it now :sweat_smile:

I recently solved a somewhat similar thing. It was about replacing {{Named}} {{parameters}} with ready-to-Format() placeholders like {1} {2} etc. and applying proper values to those. And my solution preserved formatting. I have only recorded a very improvised video on that, which I shared with patrons, but I was too overwhelmed to make a proper tutorial out of it yet.

The short answer is, it’s only possible with some effort. I don’t remember if Substitute preserves formatting (probably not / not yet?) but RegexAnything functions for sure don’t.


P.S. Oh, I guess that’s it. Here I was replacing sought words with underlined versions of them.
RegexExtract isn’t a hidden formula anymore, and we didn’t have WithName back then, so today you can easily make it into a single formula.