Ver original$regex = '#<img[^<>]*?http://(?!dominio\.com)[^<>]*?>#i';$html = <<<HTML <img src="http://placehold.it/260"> <img src="http://dominio.com" alt="x">HTML; var_dump(preg_replace($regex, '', $html));