\\1"; $search[]="/\[i](.*)\[\/i]/siU"; $replace[]="\\1"; $search[]="/([^]_a-z0-9-=\"'\/])((https?|ftp):\/\/|www\.)([^ \r\n\(\)\*\^\$!`\"'\|\[\]\{\};<>]*)/si"; $replace[]="\\1\\2\\4"; $search[]="/\[url]([^\"]*)\[\/url\]/siU"; $replace[]="\\1"; $search[]="/\[url=(['\"]?)([^\"']*)\\1](.*)\[\/url\]/siU"; $replace[]="\\2"; $text = "hallo [B]fett[/B]
http://www.yahoo.de
"; $text .= "[url=http://www.web.de]http://www.web.de[/url]
"; $text .= "[i]kursiv[/I]
"; $text .= "[B]nochmal fett[/B]
dd
"; $text .= "[url]link[/url]"; echo parse($text); function parse($text) { global $search,$replace; reset($search); reset($replace); $text = preg_replace($search,$replace,$text); return $text; } ?>