in reply to Regex - it works, but not the way i want it to =(
$message =~ s~<br>~=br=~isg; while ($message =~ s{\[code\]([\S\s].+?[\S\s])\[/code\]} { my $tmp = $1; $tmp =~ s!<!<!g; $tmp =~ s!>!>!g; $tmp =~ s!:!:!g; $tmp =~ s!\[![!g; $tmp =~ s!\\!\!g; $tmp =~ s!\]!]!g; $tmp =~ s!\)!)!g; $tmp =~ s!\(!(!g; $tmp =~ s!\|!|!g; $tmp =~ s!<!<!g; $tmp =~ s!>!>!g; $tmp =~ s!([^\&\$])(\#.*?(=br=))!$1<font color +="blue"><i>$2</i></font>!g; $tmp =~ s!(>)(\#.*?(=br=))!$1<font color="blue +"><i>$2</i></font>!g; # A fix for bug 2 $tmp =~ s!('.*?('|=br=))!<font color=r +ed>$1</font>!g; $tmp =~ s!(".*?("|=br=))!<font color +=red>$1</font>!g; $tmp =~ s!(return)([^\w])!<b>$1</b>$2!g; $tmp =~ s!(require)([^\w])!<b>$1</b>$2!g; $tmp =~ s!([^\#\d\w])(\d+)!$1<font color=green +>$2</font>!g; $tmp =~ s!(while)!<b>$1</b>!g; $tmp =~ s!(foreach)!<b>$1</b>!g; $tmp =~ s!([^\w])(for)([^\w])!$1<b>$2</b>$3!g; $tmp =~ s!([^\w])(my)([^\w])!$1<b>$2</b>$3!g; $tmp =~ s!([^\w])(sub)([^\w])!$1<b>$2</b>$3!g; $tmp =~ s!([^\w])(if)([^\w])!$1<b>$2</b>$3!g; $tmp =~ s!([^\w])(eq)([^\w])!$1<b>$2</b>$3!g; $tmp =~ s!([^\w])(ne)([^\w])!$1<b>$2</b>$3!g; $tmp =~ s!([^\w])(lt)([^\w])!$1<b>$2</b>$3!g; $tmp =~ s!([^\w])(gt)([^\w])!$1<b>$2</b>$3!g; $tmp =~ s!([^\w])(or)([^\w])!$1<b>$2</b>$3!g; $tmp =~ s!(next)!<b>$1</b>!g; $tmp =~ s!(last)!<b>$1</b>!g; $tmp =~ s!(unless)!<b>$1</b>!g; $tmp =~ s!(elsif)!<b>$1</b>!g; $tmp =~ s!(else)!<b>$1</b>!g; $tmp =~ s!([^\w])(use)([^\w])!$1<b>$2</b>$3!g; $tmp =~ s!(package)!<b>$1</b>!g; $tmp =~ s!"!"!g; $tmp =~ s!"!"!g; #" $tmp =~ s!\s{1};!;!g; #$tmp =~ s!>br>!\n!g; $tmp = "<br><font color=\"blue\"><i># $msg{cod +e}</i></font> <br><div class=\"codepost\"><code>" . $tmp . '</code><br><font color="blue"><i># +Code End</i></font></div>'; }exisog) {} $message =~ s~=br=~<br>~isg;
|
|---|