I am working on a Wordpress site and I don't want images to appear in the excerpt. 

It was quite easy with:

```
preg_replace('/<img[^>]+./','', $content);

```

to delete images but since images are wrapped within `<figure>` tags with a caption, I tried to alter the pattern to 

```
/(<figure.*?[^>]*>)(.*?)(<\/figure)/i

```

But nothing happens. What am I doing wrong?