I tried to directly convert an "eregi" expression to a "preg_match" expression.
$ACCEPT_CHARS = "a-z0-9_~#&;=./?+-";
$msg = preg_match("/ (http|https|ftp|gopher|news)://([$ACCEPT_CHARS]+)/i", "<a href=\"\\1://\\2\" target=\"_blank\">\\1://\\2</a>", $msg);
However, I get:
Warning: preg_match() [function.preg-match]: Unknown modifier '&' in /var/www/comm.borealisbbi.org/includes/functions_parse.php on line 282
What have I done wrong?
The original line was:
$msg = eregi(" (http|https|ftp|gopher|news)://([$ACCEPT_CHARS]+)", "<a href=\"\\1://\\2\" target=\"_blank\">\\1://\\2</a>", $msg);