Re: help with preg_replace please
| From: | Jason Wong | Date: | Wed, 26 Mar 2003 06:08:44 +0000 |
| Subject: | Re: help with preg_replace please | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141059@lists.php.net to get a copy of this message | ||
On Wednesday 26 March 2003 13:59, Justin French wrote:
> 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);
You seem to be using ereg syntax in a PCRE function! Replace them with their
proper PCRE counterparts.
Eg to match alphanumeric:
[0-9|a-z|A-Z] // off the top of my head, untested
etc.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Real Users never know what they want, but they always know when your program
doesn't deliver it.
*/