I am trying to write a regular expression in PHP so that only logins consisting of letters of the Russian and Latin alphabet, numbers, symbols _-*#!~. passed through _-*#!~. and space. Confused with Russian characters [Π°-Ρ] az [Π°-Ρ] , as well as with a space (used the modifier x ) Here is my regular expression:
if (!preg_match('/^[Π°-Ρa-z0-9_-]+$/ix', $login)) $errors[] = 'ΠΠ΅Π΄ΠΎΠΏΡΡΡΠΈΠΌΡΠ΅ ΡΠΈΠΌΠ²ΠΎΠ»Ρ Π² ΠΈΠΌΠ΅Π½ΠΈ'; Here, of course, not all allowed characters. Tell me please!