I have the following string
with html
:
teste = "<img src="image/teste.jpg" alt="" width="32" height="32">
<p>teste</p>
<img src="image/teste2.jpg" alt="" width="132" height="132">";
I would like a regular expression that removes the attributes, leaving only the src
and adding to the contents of src
a domain of all the images of the string, thus:
teste = "<img src="http://meudominio.com/image/teste.jpg"><p>teste</p><imgsrc="http://meudominio.com/image/teste2.jpg">";
Remembering that string
will not always come in this order, does anyone have any idea how to do it?