Closed danon closed 1 year ago
I am unable to find documentation on this. Do you have a link to share?
No, sorry I don't :/
I'm writing a regular expression library (https://t-regx.com/), and I was trying to write a parser for regular expression. I didn't know exactly which parts are recognized by the PHP, so I have writting a script that tries different set of characters and by trial-and-error run it over days.
Most return false, but \N{U+1234}
returned true - which means it was recognized, and then I latered checked it and it is in fact recognized by the PHP on all versions, with u
modifier.
@firasdib I found this reference in PCRE source code (it's in C). Maybe it'll be helpful:
It would appear that \N{2,3}
is also supported.
\N
is supported, but I wasn't aware of \N{U+NNNN}
... I'll see if this is something we want to support, as it seems very undocumented.
\N is supported, but I wasn't aware of \N{U+NNNN}..
Me neither, until recently. It's a very wierd syntax. it's clearly a legacy from perl, nonetheless it's still supported in even the newest PHP.
And it doesnt even make sense, since \N
is something utterly different to \N{U+nnnn}
.
I'll see if this is something we want to support, as it seems very undocumented.
Yea, sure. I'll leave this decision up to you.
Thank you, I have implemented support for this and it will be included in the next release.
Bug Description
In PHP dialect, notation
\N{U+1234}
matches character of unicode code point1234
.Reproduction steps
or
It should only be recognized with
u
modifier or with(*UTF)
verb.According to my understanding, for any
dd
/ddd
/dddd
that works for\x{dd}
it should also work for\N{U+dd}
.