I hoping for some pointers on the quickest way to do a replace when the document that needs bits replacing is constant (a sort of mailmerge scenario).
Of course there are lots of ways of doing replaces using string.replace and regexp but it looks like they need to parse the input document each time looking for the match. That's the bit I'm trying to optimise.