\ w will become the equivalent of \ p {L} in the future?

I don’t understand why the /u modifier \w doesn’t work, and we need to change our regular expression. Do not talk about \b .

So, does anyone know if in the new version (maybe php 6?), \w will become the same as \p{L} with /u ?

thanks

+7
source share
1 answer

\w differs from locales and, as such, it is actually more convenient NOT to capture strange runes or hieroglyphs in some cases, in favor of only characters considered word characters in the desired language system. \w and \p{L} functionally completely different. Setting up locales is something that people should know more about. Use the right tool for the job, not a sledgehammer, to hammer a 1-inch nail that would replace \w with \p{L} . Many existing functions would break if they change it. In addition, this is not entirely related to the ongoing efforts to ensure compatibility with PHP Unicode.

+1
source

All Articles