Re: preg_quote: possible arg addition for regex delimiter escaping
| From: | Andrei Zmievski | Date: | Thu, 25 May 2000 20:50:13 +0000 |
| Subject: | Re: preg_quote: possible arg addition for regex delimiter escaping | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-19448@lists.php.net to get a copy of this message | ||
On Thu, 25 May 2000, Daniel Beckham wrote:
> You could get around this by using preg_replace along with preg_quote, but
> I think a more elegant solution would be to add an extra, optional argument
> to preg_replace that would allow you to specify an additional character to
> be quoted along with the others. This would not break current
> functionality but would add to the usefulness of the function. Also, it
> would most likely cut down on the number of bug reports that will be
> generated because of people thinking that the function should also quote
> the "/" character, the most commonly used Perl regex delimiter...
>
> After all that, my question is.. does anyone care? If I add this
> functionality to php_pcre.c, is it likely to be added to the cvs tree, or
> will it be ignored? Would anyone, besides me, like to see this
> functionality added?
>
> Your input is appreciated,
You could also get around it by using one of the regex reserved
characters as a delimiter. But you are right, in general, this
functionality is needed. I just added it to CVS version - but the CVS is
being moved to another machine, so don't try to update your sources
right away.
-Andrei
Any sufficiently advanced Operating System
is indistinguishable from Linux.
- Jim Dennis