This question has already been answered:
Help create a regular calendar that deletes everything except Russian, Latin letters and numbers, and also leave spaces ... For example, this one does it as it should, but removes spaces: $result = preg_replace('/[^a-zа-яё]+/iu', '', $text);