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:
<img src="test.jpg"><p>some text</p><img src="test.jpg">
and get back:
<p>some text</p>
Unfortunately, when I use {{ snippet|replace('/<img(.*)>/', '') }}
it matches the entire string, from the opening <img
to the second image's closing >
rather than matching both <img>
tags individually. How can I force the regex to match only through the first >
it finds before continuing?