So I have a large string of text that can contain links to websites or images. I want to convert these plain URL's to html elements.
Example input:
Hi my name is Harry you can find my website here: http://www.harry-rox.com. Oh and what do you think of my my wife: http://www.anothersite.com/wife.jpg?
Needed output:
Hi my name is Harry you can find my website here: <a href="http://www.harry-rox.com">http://www.harry-rox.com</a>. Oh and what do you think of my my wife: <img src="http://www.anothersite.com/wife.jpg" />?
Note;
I found some regex examples that do one of both conversions (URL to href element, or image URL to tag, but I can't seem to find way to combine them! :(