Here is a unique string with some embedded HTML code:
This is the first sentence. In the second sentence, there is a <a href="http://google.com">Google</a> link! The third sentence may have an image like <img src="http://link.to.image.com/hello.png" /> and ends with a question mark. The last sentence is bolded <b>like this</b>??
I am looking to divide this unique string into sentences and keep the HTML intact. Here is the desired output:
[0] = This is the first sentence.
[1] = In the second sentence, there is a <a href="http://google.com">Google</a> link!
[2] = The third sentence may have an image like <img src="http://link.to.image.com/hello.png" /> and ends with a question mark.
[3] = The last sentence is bolded <b>like this</b>??
Any suggestions on how to achieve this? Maybe using Regex and match?
I found a similar solution that almost fits my needs, but it doesn't handle the HTML tags: JavaScript Split Regular Expression keep the delimiter