Why can that be
preg_match('/^[а-яА-ЯЁёa-zA-Z0-9_]+$/', $userName) returns true for the letter "PP", "pp", "UU", "ee", "yaya" and false for "tm", "yy", "yu" and others?
UTF-8 encoding. Php 5.2.17
I also noticed that strlen($userName) , for example, for "nn" = 4, and for "yy" = 2.
P.S. Wherein
preg_match('/^[_0-9A-Za-zА-Яа-пр-яЁё]+$/', $userName) works.