/\w/u (Bugs)
Isn't it the wrong logic? If 'тест' matches against
/[^\w]/u
, wich means all alphanumeric chars and "_" (/[^\w]/
) in unicode range (u
), the test passes. Or am I wrong?
[^...] negates it. So it should match if there is at least one non alphanumeric character, shouldn't it?
But let's just do it the other way round:
<?php if(preg_match("/\w/u", 'тест')) echo 'Alphanumeric charecter(s) found!'; ?>
→ Doesn't output anything on my server.