help with preg_replace please
| From: | Justin French | Date: | Wed, 26 Mar 2003 05:59:09 +0000 |
| Subject: | help with preg_replace please | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-141058@lists.php.net to get a copy of this message | ||
Hi,
Total newbie on reg exps, and even worse with preg!!!
I get the following error:
Parse error: parse error, expecting
T_VARIABLE' or '$'' in
/usr/local/apache/htdocs/lib/lib_string.inc on line 218
Using this code:
$str =
preg_replace("!([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])!ei", "<a
href=\"{$1}://{$2}{$3}\">{$2}{$3}</a>", $str);
Can anyone point to the problem?
The aim is to perform functions on $2 & $3.
TIA
Justin French