I don't understand why with /u
modifier \w
doesn't work, and we have to change our regex. Not to talk about \b
.
So anyone know if on a new version (maybe php 6?) \w
will become the same as \p{L}
with /u
?
Thanks
\w
differs with locales, and as such, it is actually handy NOT to capture strange runes or hieroglyphs in some cases, in favor of only characters considered word characters in the desired locale. \w
& \p{L}
are functionally totally different. Configuring locales is what people should be more aware of. Use the right tool for the job, and not a sledgehammer to hammer a 1-inch nail, which substituting \w
for \p{L}
would be. A lot of existing functionality would break if they did change it. Also, this is entirely unrelated to the ongoing effort of making PHP unicode compatible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With