|replace filter is matching too many characters I'm looking to format out image tags from a string using the |replace filter. The behavior I'm looking for is to give it a string like this:

&lt;img src="test.jpg"&gt;&lt;p&gt;some text&lt;/p&gt;&lt;img src="test.jpg"&gt;

and get back:

&lt;p&gt;some text&lt;/p&gt;

Unfortunately, when I use {{ snippet|replace('/&lt;img(.*)&gt;/', '') }} it matches the entire string, from the opening &lt;img to the second image's closing &gt; rather than matching both &lt;img&gt; tags individually. How can I force the regex to match only through the first &gt; it finds before continuing?
Something like this should work:

{{ snippet|replace('/&lt;img([\w\W]+?)&gt;/', '') }}


You can see an explanation of the regex in the right column of https://regex101.com/r/DvJHeY/1