$re = '/<img(?:.+)?src\s*=\s*(?:"|\')[a-zA-Z0-9\!\#\$\&-\:\;\=\?-\[\]_~\|%\/]+(?:"|\')(?:.+)?>/mi';
$str = '<img src="http://www.test.de/wtf.png#test12%afsfas~123_sf-asff$!&arg[test]=1">
<p>test tet agsa sgh shs#</p>
<p>Bilder für Proxy Test</p>
<p><img alt="" src="http://www.eso-schatzsucher.de/teso/wcf/images/stylePreview.png" style="height:256px; width:256px" /></p>
<p> </p>
<p><img alt="" src="http://www.eso-schatzsucher.de/teso/eso/images/treasure/37b84fd6ae11fd26f45119e256e90973e145e291.png" style="height:300px; width:300px" /></p>
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php