function WakabaMark($string){ $patterns = array( '`\\\\\\\\`', '`\\\\\*`', '`\\\\_`', '`\\\\\:`', '`\\\\\^`', '`\\\\\#`', '`\\\\\%`', '`\*\*(.+?)\*\*`is', '`\*(.+?)\*`is', '`\:\:(.+?)\:\:`is', '`\^\^(.+?)\^\^`is', '`\#\#(.+?)\#\#`is', '`\%\%(.+?)\%\%`is', '`\_\_(.+?)\_\_`is', '`\_(.+?)\_`is', ); $replaces = array( '\', '*', '_', ':', '^', '#', '%', "\\1", "\\1", "\\1", "\\1", "\\1", "\\1", "\\1", "\\1" ); $link_app = stripos($string, "://"); $space_app = 0; if ($link_app != false) { $space_app = strpos(substr($string, $link_app, strlen($string)), " "); if ($space_app != false) { $space_app = $link_app + $space_app; } else { $space_app = strlen($string); } } $before = substr($string, 0, $link_app); $middle = substr($string, $link_app, $space_app-$link_app); $after = substr($string, $space_app); $before = preg_replace($patterns, $replaces , $before); $after = preg_replace($patterns, $replaces , $after); $string = $before.$middle.$after; $string = preg_replace_callback('`\@\@(.+?)\@\@`is', array(&$this, 'code_callback'), $string); return $string; }