There is a check for the presence of Cyrillic in the login:
if (!preg_match("/[а-я]+/i", $_POST['Login'])) { /* норм */ } else { /* не норм */ }
How to add a space check?
There is a check for the presence of Cyrillic in the login:
if (!preg_match("/[а-я]+/i", $_POST['Login'])) { /* норм */ } else { /* не норм */ }
How to add a space check?
\s
matches any whitespace character (space, tab, new line, format translation, etc.)
Your logic is wrong, on the contrary you need to:
if (!preg_match("/[а-я ]+/i", $_POST['Login'])) { /* не норм */ } else { /* норм */ }
and for unicode u add
Vashhet so.
if ( preg_match('/[а-я\s]+/i', $_POST['Login']) ) { /* норм */ } else { /* не норм */ }
Source: https://ru.stackoverflow.com/questions/88928/
All Articles