Avatar

/[^\w]/u (Bugs)

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

Hello

Together with "u" (/\w/u) it should act for all unicode chars in any writing system, numbers and "_".


<?php
if(preg_match("/[^\w]/u", 'тест')) echo 'Non alphanumeric charecter(s) found!';
?>

→ Non alphanumeric charecter(s) found!

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?

Tschö, Auge

--
Trenne niemals Müll, denn er hat nur eine Silbe!


Complete thread:

 RSS Feed of thread