in reply to looking for a regexp

This will do all you ask.
s/\s([^<]*<[^>]*>|$)/&nbsp;$1/g;
--
Casey

Replies are listed 'Best First'.
RE: Re: looking for a regexp
by takshaka (Friar) on Jun 08, 2000 at 22:09 UTC
    That is, unless you ask it to do-- <B>This</B> Line <I>fails</I>. This is quickly becoming a FAQ. Hopefully it'll be in the new Q&A section.

    See Substitution outside of HTML TAGS or other threads turned up by searchng for 'html tags'.