How can I write a pattern, in PHP so that I can find these variations, which are scattered throughout text coming from the database
<div id="attachment_38847" style="width: 1610px" class="wp-caption alignnone"><img src="http://test.com/wp-content/uploads/2016/12/224157043765335545.jpg" alt="mers"><p class="wp-caption-text">Mers</p></div>