As an example of some urls lumped into an array as a test:
$arr = array('<img src="www.whatever.com/images/image-01.jpg" />', '<img src="http://www.mysite.com/images/image-01.jpg" />', '<img src="booyah.com/gui/images/image-01.jpg" />');
foreach($arr as &$val){
$val = preg_replace('#(?:<img.*?src=[\'"](?!http://www\.mysite\.com/)[^>]+>)#', '', $val);
}
echo '<pre>'.print_r($arr, true);
Output (when viewing source):
Array
(
[0] =>
[1] => <img src="http://www.mysite.com/images/image-01.jpg" />
[2] =>
)
In your case, just plug the entire posting entry into the preg_replace instead of the sample array.