In principle, the regular checker checks that the name contains only letters Russian and Latin, and a few additional ёЁҷҶқҚӯӮҳҲӣӢғҒ and the name consists of 3 to 25 characters.
elseif (!preg_match('/[a-zA-Zа-яА-ЯёЁҷҶқҚӯӮҳҲӣӢғҒ]{3,25}$/i', $name)) { $this->setFieldError("surname", "Неверный формат имени.<br>Имя должна состоять только из букв и должно содержать 3-25 букв"); return; } On online tools like https://regex101.com everything works fine, but it works differently on the server. For example, on the server with the values "Shukhratҷon" does not show an error (as it should), but with the value "Shukhrat" already shows an error.
But in the second case, too, should not show an error, what is happening?
What am I doing wrong?
/^[a-zA-Zа-яА-ЯёЁҷҶқҚӯӮҳҲӣӢғҒ]{3,25}$/u- Visman^not a negation, but the beginning of a line. Denying it like this[^a-zA-Z]- Visman