I have a long string of html saved to the db. The following code may appear multiple times in the overall saved html:

Code:
<div class="{ELEMENT1}">
<table width="20" cellspacing="0" cellpadding="2" border="0" style="margin: 8px;">
    <tbody>
        <tr>
            <td><img width="300" height="200" src="http://www.mywebsite.com/images/{ELEMENT2}" alt="" /></td>
        </tr>
        <tr>
            <td align="right" class="articlebluesmall">{ELEMENT3}<br />
            </td>
        </tr>
<!-- This row may be optional -->
        <tr>
            <td class="articlebluesmall">{ELEMENT4}</td>
        </tr>
<!-- end optional row -->
    </tbody>
</table>
</div>
For this example, I have replaced the actual text in the html with dummy text (ELEMENTX) to indicate the pieces of the code that I want to pull out in my regex. Here's what I have so far:

Code:
$match = "/<div class=\"(.*)\">.*http:\/\/www\.mywebsite\.com\/images\/(.*)\.jpg.*class=\"articlebluesmall\">(.*)<(.*)<\/div>/";
When using it with preg_match_all, I'm getting empty values; it's clearly not finding anything. What am I doing wrong? Also, how do I handle the part of the search that is optional (i.e. sometimes it will be there and sometimes it won't)