I have a string:
<p>text1</p>
<p>text2 <span class="theClass">text3</span></p>
What I need to achieve is to split this string into an array containing html tags and pure text. something like:
var array= ["<p>", "text1", "</p>", ...];
I've tried to use regexp: /(?=<)|(?<=>)/g
, but javascript does not allow me to use lookbehind expression. Any ideas on how to do this?