Re: cvs: pear /Contact_Vcard_Build Contact_Vcard_Build.php
| From: | Daniel Convissor | Date: | Sun, 29 May 2005 15:30:54 +0000 |
| Subject: | Re: cvs: pear /Contact_Vcard_Build Contact_Vcard_Build.php | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-37868@lists.php.net to get a copy of this message | ||
On Sun, May 29, 2005 at 11:14:57AM -0400, Philippe Jausions wrote:
> > $text = preg_replace('/(?<!\\\\)(:|;)/i', '\\\$1', $text);
>
> If anything, the "i" modifier can be dropped
Good catch. The "i", for case insensitivity, is supurfluous.
> the '\\\$1' should be '\\$1'...
Nope. The extra "\" is needed for the regex parser to properly do the
replacement. I tested it.
By the way, when I looked at the source code subsequently, I saw there are
two MORE preg_replace() calls. All four calls should be merged into one.
Thanks,
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409