I have a string and this string could contain some occurrences like:
http://site/image.jpg
What is the right way to replace, when it's present, this kind of occurrence by
<img src="http://site/image.jpg">
What is really important, is to replace only occurrences beginning by http and which ending by .jpg, .png and gif by the <img> HTML tag.
So if among all the text there is a URL link of any images, it's formatted by a HTML tag to display the image.