Code: Alles auswählen
suche:
// matches an "xxxx://yyyy" URL at the start of a line, or after a space. - the line is longer
$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);
ersetze:
$ret = preg_replace("#([\n ])([a-z]+?)://([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)#ei", "'\\1<a href=\"http://dein forum.de/rlink/rlink.php?url=http://anonym.to/?'.urlencode('\\2://\\3'). '\" target=\"_blank\">\\2://\\3</a>'", $ret);
suche:
// matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing - the line is longer
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);
ersetze:
$ret = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]*)?)#ei", "'\\1<a href=\"http://deinforum.de/rlink/rlink.php?url=http://anonym.to?'.urlencode('http://www.\\2.\\3\\4').'\" target=\"_blank\">www.\\2.\\3\\4</a>'", $ret);