Ancestors

Toot

Written by dseguy on 2024-11-26 at 22:12

TIL that there are two ways to protect characters in a #PHP regex : preg_quote() and \Q .... \E.

It looks scary, but it might be very useful indeed.

https://php-tips.readthedocs.io/en/latest/tips/escaped_regex.html

[#]phptip #phptrick

=> View attached media

=> More informations about this toot | More toots from dseguy@phpc.social

Descendants

Written by Tim Düsterhus on 2024-11-26 at 22:18

@dseguy And what if $regex contains the substring \E? 🙂

=> More informations about this toot | More toots from timwolla@phpc.social

Written by dseguy on 2024-11-27 at 06:40

@timwolla Indeed 😭

This is the moment where having 2 solutions for the same job is good.

=> More informations about this toot | More toots from dseguy@phpc.social

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113551550458901436
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
287.829884 milliseconds
Gemini-to-HTML Time
0.85229 milliseconds

This content has been proxied by September (3851b).