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
=> More informations about this toot | More toots from dseguy@phpc.social
@dseguy And what if $regex
contains the substring \E
? 🙂
=> More informations about this toot | More toots from timwolla@phpc.social
@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 This content has been proxied by September (3851b).Proxy Information
text/gemini