trew Цитата: Прошу прощения, а можно поднять готовое в верхний пост, чтоб повысить восприятие всего этого
В первый пост - не знаю, стоит ли.
Смотри, как должна выглядить подпрограмма после всех фиксов:
Код: sub ikoncode {
my $post = shift;
###not java### by DimoN
$post =~ s/(\[img\])(.*?)(script:)(.*?)(\[\/img\])/$2$3$4\[<font color=red>Недопустимое действие! :moderator:<\/font>\]/isg;
###not java end###
###not view-source &mailto###
$post =~ s/(\[img\])(.*?)(view-source:)(.*?)(\[\/img\])/$2$3$4\[<font color=red>Недопустимое действие! :moderator:<\/font>\]/isg;
$post =~ s/(\[img\])(.*?)(mailto:)(.*?)(\[\/img\])/\[<font color=red>Недопустимое действие! :moderator:<\/font>]/isg;
###not view-source end###
$post =~ s/\<p>/<br><br>/isg;
$post =~ s|\[\[|\{\{|g;
$post =~ s|\]\]|\}\}|g;
$post =~ s|\n\[|\[|g;
$post =~ s|\]\n|\]|g;
$post =~ s|<br>| <br>|g;
$post =~ s|\[hr\]\n|\<hr width=40\% align=left>|g;
$post =~ s|\[hr\]|\<hr width=40\% align=left>|g;
##таблица
$post =~ s/\[table\]\[tr\]/\[table\]/isg;
while ($post =~ s{\[table\]([\S\s].+?[\S\s])\[/table\]}
{my $Tmp = $1;
$Tmp =~ s/\<br>/ /g;
$Tmp =~ s/\[tr\]/ <\/td><\/tr><tr class=lgf><td>/g;
$Tmp =~ s/\[tab\]/ <\/td><td>/g;
$Tmp = qq|<table cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#FFFFFF\" width=\"75%\" border=\"1\" bordercolor=\"#EEEEEE\"><tr class=lgf><td>$Tmp<\/td><\/tr><\/table>|;
}exisog) {}
## end таблица
$post =~ s/\[q\]\s*(.*?)\s*\[\/q\]/<blockquote class=n2><span class=s>Цитата:<\/span><hr noshade size=1>$1<hr noshade size=1><\/blockquote>/isg;
$post =~ s/\[quote\]\s*(.*?)\s*\[\/quote\]/<blockquote class=n2><span class=s>Цитата:<\/span><hr noshade size=1>$1<hr noshade size=1><\/blockquote>/isg;
#$post =~ s/\[quote\](.*)\[quote\](.*)\[\/quote](.*)\[\/quote\]/<blockquote><hr><font size=\"1\" face=\"verdana, helvetica\">$1<\/font><blockquote><hr><font size=\"1\" face=\"verdana, helvetica\">$2<\/font><hr><\/blockquote><font size=\"1\" face=\"verdana, helvetica\">$3<\/font><hr><\/blockquote>/isg;
#$post =~ s/\[quote\]\s*(.*?)\s*\[\/quote\]/<font face=arial size=1><blockquote><hr noshade size=1>$1<hr noshade size=1><\/blockquote><\/font>/isg;
$post =~ s/\[url\](\S+?)\[\/url\]/<a href=\"$1\"\ target=\"_blank\">$1<\/a>/isg;
$post =~ s/\[url=http:\/\/(\S+?)\]/<a href=\"http:\/\/$1\"\ target=\"_blank\">/isg;
$post =~ s/\[url=(\S+?)\]/<a href=\"http:\/\/$1\"\ target=\"_blank\">/isg;
$post =~ s/\[\/url\]/<\/a>/isg;
$post =~ s/(^|\s|\<br\>)(http:\/\/\S+)/$1<a href="$2" target=_blank>$2<\/a> /isg;
$post =~ s/(^|\s|\<br\>)(https:\/\/\S+)/$1<a href="$2" target=_blank>$2<\/a> /isg;
$post =~ s/(^|\s|\<br\>)(ftp:\/\/\S+)/$1<a href="$2" target=_blank>$2<\/a> /isg;
$post =~ s/(^|\s|\<br\>)(www\.\S+)/$1<a href="http:\/\/$2" target=_blank>$2<\/a> /isg;
# Добавляем новые коды [c] и [s]
$post =~ s/\[c\](.*?)\[\/c\]/<center>$1<\/center>/isg;
$post =~ s/\[s\](.*?)\[\/s\]/<span class=s>$1<\/span>/isg;
$post =~ s/\[b\]/<b>/isg;
$post =~ s/\[\/b\]/<\/b>/isg;
$post =~ s/\[i\]/<i>/isg;
$post =~ s/\[\/i\]/<\/i>/isg;
$post =~ s/\[size=\s*(.*?)\s*\]\s*(.*?)\s*\[\/size\]/<font size=\"$1\">$2<\/font>/isg;
$post =~ s/\[font=\s*(.*?)\s*\]\s*(.*?)\s*\[\/font\]/<font face=\"$1\">$2<\/font>/isg;
$post =~ s/\[u\]/<u>/isg;
$post =~ s/\[br\]/<br>/isg;
$post =~ s/\[\/u\]/<\/u>/isg;
$post =~ s/\[img\](.+?)\[\/img\]/<img src=\"$1\">/isg;
$post =~ s/\[color=(\S+?)\]/<font color=\"$1\">/isg;
$post =~ s/\[\/color\]/<\/font>/isg;
$post =~ s/\\http:\/\/(\S+)/<a href=\"http:\/\/$1\"\ target=\"_blank\">http:\/\/$1<\/a>/isg;
$post =~ s/(\[list\])(.+?)(\[\/list\])/<UL>$2<\/UL>/isg;
$post =~ s/(\[list=)(A|1)(\])(.+?)(\[\/list\])/<OL TYPE=$2>$4<\/OL>/isg;
$post =~ s/(\[\*\])/<LI>/isg;
$post =~ s/\[code\](.+?)\[\/code\]/<blockquote><font size=\"1\" face=\"Courier New\">Код:<\/font><hr><font face=\"Courier New\" size=\"2\"><pre>$1<\/pre><\/font><hr><\/blockquote>/isg;
$post =~ s/\[code\](.+?)\[\/code\]/<blockquote><font size=\"1\" face=\"Courier New\">Код:<\/font><hr><font face=\"Courier New\"><pre>$1<\/pre><\/font><hr><\/blockquote>/isg;
#Выключаем автоподсветку мыла DimoN
#$post =~ s/(\S+?)\@(\S+)/<a href=\"mailto:$1\@$2\"\>$1\@$2<\/a>/ig;
$post =~ s/\[email=(\S+?)\]/<a href=\"mailto:$1\">/isg;
$post =~ s/\[\/email\]/<\/a>/isg;
$post =~ s/(\[FLASH SIZE=1\])(.+?)(\[\/FLASH\])/<OBJECT WIDTH=80 HEIGHT=60><PARAM NAME=movie VALUE="$2"><PARAM NAME=quality VALUE=high><PARAM NAME=scale VALUE=exactfit><PARAM NAME=menu VALUE=false><PARAM NAME=bgcolor VALUE=$BGColor><EMBED src="$2" quality=high menu=false scale=exactfit WIDTH=80 HEIGHT=60 swLiveConnect=true TYPE="application\/x-shockwave-flash"><\/EMBED><\/OBJECT>/isg;
$post =~ s/(\[FLASH SIZE=2\])(.+?)(\[\/FLASH\])/<OBJECT WIDTH=160 HEIGHT=120><PARAM NAME=movie VALUE="$2"><PARAM NAME=quality VALUE=high><PARAM NAME=scale VALUE=exactfit><PARAM NAME=menu VALUE=false><PARAM NAME=bgcolor VALUE=$BGColor><EMBED src="$2" quality=high menu=false scale=exactfit WIDTH=160 HEIGHT=120 swLiveConnect=true TYPE="application\/x-shockwave-flash"><\/EMBED><\/OBJECT>/isg;
$post =~ s/(\[FLASH SIZE=3\])(.+?)(\[\/FLASH\])/<OBJECT WIDTH=320 HEIGHT=240><PARAM NAME=movie VALUE="$2"><PARAM NAME=quality VALUE=high><PARAM NAME=scale VALUE=exactfit><PARAM NAME=menu VALUE=false><PARAM NAME=bgcolor VALUE=$BGColor><EMBED src="$2" quality=high menu=false scale=exactfit WIDTH=320 HEIGHT=240 swLiveConnect=true TYPE="application\/x-shockwave-flash"><\/EMBED><\/OBJECT>/isg;
$post =~ s/(\[FLASH=)(\S+?)(\,)(.+?)(\])(.+?)(\[\/FLASH\])/ <embed src="$6" menu=false scale=exactfit HEIGHT="$4" WIDTH="$2" quality="high"><\/embed> /isg;
$post =~ s/(\[center\])(.+?)(\[\/center\])/<center>$2<\/center>/isg;
$post =~ s/(\[sound\])(\S+?)(\.mid|\.midi|\.wav)(\[\/sound\])/<EMBED SRC="$2$3" AUTOSTART=FALSE LOOP=FALSE WIDTH=100><\/EMBED> /isg;
$post =~ s|\{\{|\[|g;
$post =~ s|\}\}|\]|g;
return $post;
} # end routine