On 21/06/2024 19:03, Larry Garfield wrote:
* Regex pattern

This one is interesting as well ... but I would expect native regex
syntax first before introducing it as part of a different RFC. Similar
as generics.
Named capture groups are already part of regex syntax, just not often used.  
The example is not introducing anything new there.  (Although Ilija tells me it 
may be hard to implement, so it may get postponed anyway.  TBD.)


I think what Marc means is that it's weird to see the regex syntax outside of a quoted string, since we don't currently have that syntax defined in PHP.

It's not even clear what the constraints of that syntax would be; for instance, this is valid PHP:

$result = preg_match(subject: $string, pattern: "#
(int|string)
/*(.*/)
#xi");

But I'm guessing it would be a challenge to parse this:

$result = $string is #
(int|string)
/*(.*/)
#xi;

The simple answer is probably to use a more limited syntax, but defining that syntax probably deserves its own discussion.


--
Rowan Tommins
[IMSoP]

Reply via email to