Re: preg_quote: possible arg addition for regex delimiter escaping
| From: | Andrei Zmievski | Date: | Fri, 26 May 2000 12:57:47 +0000 |
| Subject: | Re: preg_quote: possible arg addition for regex delimiter escaping | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-19499@lists.php.net to get a copy of this message | ||
On Thu, 25 May 2000, Chuck Adams wrote:
>
> I'm not sure what an extra flag nets you other than eating up an arg
> slot (since PHP has no named args). It may be additive, but if
> another option gets added, would it be another flag? If it's more
> than a flag's worth of option, is someone going to have to do
> something like:
>
> preg_match("/$regex/", $teststr, PREG_QUOTEDELIM, $blah); ??
>
> When the value of that flag wasn't necessary before?
> This is exactly what preg_quote was designed for, not extra args. I
> personally find using another function to be the most orthogonal and
> therefore most elegant solution.
>
> ... Not that I'd mind seeing named args in PHP though ;)
We are talking about adding extra arg to preg_quote(), which would
specify an additional character to be quoted - usually, it would be the
delimiter. We're not changing preg_match().
-Andrei
Documentation is worth it just to be able
to answer all your mail with 'RTFM'. -- Alan Cox