How can I use regular expressions in Javascript in order to split a text by words (utf8) or tags? For example, given the following:
Lorem ipsum dolor <b>sid</b> amet et <a href="asdasd">amet et</a> fugit
I'd like to have it splitted like this:
Lorem
ipsum
dolor
<b>
sid
</b>
amet
et
<a href="asdasd">
amet
et
</a>
fugit