$text = preg_replace('#\[url=([\r\n]*)(http://|ftp://|https://|ftps://)([^\s\'\"\+\(\)]*?)\](.*?)([\r\n]*)\[/url\]#sie', "'', '', '\\2\\3').'\' target=\'_blank\' title=\''.str_replace('
', '', '\\2\\3').'\'>\\4
'", $text);