remove gif image only from content with full domain name

Trying to remove gif based on this answer

remove gif image only from content

but it removes if there is only image name in img src

for eg.    $content = "this is <img src="test.gif"> something with an <img 
      src=test.png"/>

in it.";

it works but for full domain its not working

  $content = "this is <img src="https://ecwowocc.com/test.gif"/> something with an <img 
  src=https://ecwowocc.com/test.png"/> in it.";
  $content = preg_replace("/<img[^>]+src=\\?(?:"|')[^.]+\.gif\\?(?:"|')[^>]+\>", "(image) ", $content); 
  echo $content;