You can try to match on the attributes you want to save from your input, you can try to get the parts that look like an <img>
tag first, and then cherry-pick the attribute looking parts of them you are interested in:
$input = 'some other content
<img alt="FACE="Monospace,Courier">LRPatches, Sky clear, Q1020</FONT><Mist, >"
src="http://www.vremea.com/images/fogshow.gif" width="50" height="50"/>
<span class="some"> more other content
</span>
<img alt="FACE="Monospace,Courier">LRPatches, Sky clear, Q1020</FONT><Mist, >"
src="http://www.vremea.com/images/fogshow.gif"
width="50"
height="50"/> <span class="some"> more other content
';
preg_match_all('/<img.+?\/>/sim', $input, $img_parts);
foreach ($img_parts[0] as $img_part) {
$attrs = array();
preg_match_all('/(?<key>src|width|height)\s*=\s*"(?<value>[^"]+)/i', $img_part, $m);
foreach ($m['key'] as $i => $key) {
$attrs[] = "{$key}=\"{$m['value'][$i]}\"";
}
print "<img ".join(' ', $attrs)." />\n";
}