I get a "syntax error, unexpected ']'" in my code, can anybody tell what's wrong with it? I think I have my problem solved with the regex expression but I got that error message.
<?php
$url = $_GET['url'];
$sourcecode = file_get_contents($url);
preg_match('@^(?:http://)?([^/]+)@i',
$url, $matches);
$host = $matches[1];
$replaceaddress = preg_replace("/[^src="]([a-z]+.[a-z]+.[a-z]+.[a-z]+.[a-z]+.[a-z]+.[a-z]+.|.[^'"][a-z]+.[a-z]+.[a-z]+.[a-z]+.[a-z]+.[a-z]+.|.[^"][a-z]+.[a-z]+.[a-z]+.[a-z]+.[a-z]+.|.[^"][a-z]+.[a-z]+.[a-z]+.[a-z]+.|.[^"][^'][a-z]+.[a-z]+.[a-z]+.|[^"][a-z]+.[a-z]+.|.[^"][^'][a-z]+/)[a-z]+(\.png|\.jpg|\.gif|\.bmp)/", "http://www.johninteractive.net/proxy/proxyimage.php?url=http://" . $host . "/$0", $sourcecode);
echo $replaceaddress;
?>