Hi
On 6/29/24 23:23, mickmackusa wrote:
If one can easily use a function incorrectly in a way that is not
*immediately* apparent, then I consider the function to be badly
designed.
Does that philosophy also cover preg_quote()? I've lost count of the
Yes, it does.
Would it be reasonable to create `preg_escape()` which also (sometimes
unnecessrily) includes the (de facto default delimiter) forward slash in
its default list of escaped characters so that preg_quote() could
eventually be deprecated? As far as I know this would do no harm, will
I'd rather see the delimiter being a required parameter or a
well-designed (object-oriented) API, such as the one provided by T-Regx:
https://github.com/t-regx/T-Regx?tab=readme-ov-file#prepared-patterns
But as Gina said, this is something for another discussion.
Best regards
Tim Düsterhus