Regular expressions are not suited for every task. If your string can contain arbitrary HTML, than it's not possible to handle all cases using regular expressions, because HTML is a context-free language and regular expressions covers only a subset of them. Now before messing around with loops and a load of code to handle this, let me suggest the following:
If you are in a browser environment or have access to a DOM library, you could put this string inside a temporary DOM element, then work on the text nodes and then read the string back.
Here's an example using a lib I wrote some month and updated now which is called Linguigi
var element = document.createElement('div');
element.innerHTML = 'This is <b>very bold</b> word.';
var ling = new Linguigi(element);
ling.eachWord(true, function(text) {
return '<w>' + text + '</w>';
});
ling.eachToken(/ +/g, true, function(text) {
return '<s>' + text + '</s>';
});
alert(element.innerHTML);
Example: http://prinzhorn.github.com/Linguigi/ (hit the Stackoverflow 12758422 button)