Re: help with preg_replace please
| From: | Jason Paschal | Date: | Wed, 26 Mar 2003 06:35:02 +0000 |
| Subject: | Re: help with preg_replace please | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-141060@lists.php.net to get a copy of this message | ||
what that guy said, or use ereg_replace instead of preg_...
From: Jason Wong <php-general@gremlins.biz>
Reply-To: php-general@lists.php.net
To: php-general@lists.php.net
Subject: Re: [PHP] help with preg_replace please
Date: Wed, 26 Mar 2003 14:08:44 +0800
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.
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail