It actually kind of depends on the text. If you've got tags within the area you're wanting to replace, the regex replace on the innerHTML won't work that well I don't suspect.
Something like this:
<p><strong>F</strong>irst letter of paragraph</p>
The alternative is to iterate over text nodes within the DOM. If you're not targeting IE, you can use the TreeWalker to easily get a collection of text nodes in document order. If you need to target IE, this seems to be a good summary of other ways to iterate text nodes
Then the idea would be to iterate over the text nodes, do the regex split on the node data and wrap each child node in a span with background to highlight.
Here's a fairly hastily written example, but it should give you the idea.
var iterator = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null, false),
template = document.createElement('span'),
span,
node,
text,
newNode;
template.style.backgroundColor = 'yellow';
while ((node = iterator.nextNode())) {
text = node.data.split(/\b/g);
for (var i = 0, len = text.length; i < len; i++) {
newNode = document.createTextNode(text[i]);
if (text[i].search(/\w+/) >= 0) {
span = template.cloneNode(false);
span.appendChild(newNode);
node.parentNode.insertBefore(span, node);
} else {
node.parentNode.insertBefore(newNode, node);
}
iterator.currentNode = newNode;
}
node.parentNode.removeChild(node);
}
It won't be the fastest method available, but it should be more accurate than a regex replace on the innerHTML. It's also not that difficult to modify the loop to use window.setTimeout to animate the highlighting.