Avatar

/\w/u (Bugs)

by Alex ⌂, Wednesday, February 03, 2010, 20:29 (5196 days ago) @ Auge

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.


Complete thread:

 RSS Feed of thread