This is my string. It contains some HTML:
First sentence. Here is a <a href="http://google.com">Google</a> link in the second sentence! The third sentence might contain an image like this <img src="http://link.to.image.com/hello.png" /> and ends with !? The last sentence looks like <b>this</b>??
I want to split the string to sentences (array), keep the HTML as well as the separator. Like this:
[0] = First sentence.
[1] = Here is a <a href="http://google.com">Google</a> link in the second sentence!
[2] = The third sentence might contain an image like this <img src="http://link.to.image.com/hello.png" /> and ends with !?
[3] = The last sentence looks like <b>this</b>??
Can anybody suggest me a way to do this please? May be using Regex and match?
This is very close to what I’m after, but not really with the HTML bits: JavaScript Split Regular Expression keep the delimiter