regex - PHP: Filter all codes except scripts and images from MY site? -


Let's say a member has left a comment.

  Hi! Look at these cars & lt; Img src = "http://www.mysite.com/possiblefolder/possiblesub/image.jpg" & gt; & Lt; / Img & gt; & Lt; Img src = "http://othersite.com/possiblefolder/possiblesub/image.jpg" & gt; & Lt; / Img & gt; & Lt; Img src = "http://www.mysite.otherside.com/possiblefolder/image.jpg" & gt; & Lt; / Img & gt; Which is your favorite?   

I should come as a result:

  Hi! Look at these cars & lt; Img src = "http://www.mysite.com/possiblefolder/possiblesub/image.jpg" & gt; & Lt; / Img & gt; Http://www.mysite.otherside.com/possiblefolder/possiblesub/image.jpg Which is your favorite?   

I want to filter all the code except the images and scripts from my site. Anyone got any ideas?

Hope this helps

    

is the tag used by Group 1 and the Group 2 is the "src" value, so that you can replace it.

Enter image details here < / Div>

Comments