\w
is defined to be [A-Za-z0-9_]
iirc.
try preg_match('/^[\pL-]+$/u', $value)
instead.
Question
When using preg_match('/^[\w-]+$/u', $value)
my development server (5.3.15
) returns true for umlaut words. My live server (5.3.2-1ubuntu4.19
) returns false.
What do I have to do to make the live server behave the same way as my development server? (Unfortunately, I cannot simply update the php version.)
The code is exactly the same on both machines. Both serve pages as UTF8.
Solution
\w
is defined to be [A-Za-z0-9_]
iirc.
try preg_match('/^[\pL-]+$/u', $value)
instead.