Answer the question
In order to leave comments, you need to log in
How to write a search for Russian capital letters in a string (regexp, php)?
File encoding: UTF-8
Code:
$string = "Test123 Тест";
echo preg_replace('![A-Z|А-Я]!','',$string);
est123 ст
Answer the question
In order to leave comments, you need to log in
echo preg_replace('![A-Z|А-Я]!u','-',$string);
www.php.net/manual/ru/reference.pcre.pattern.modif...
Modifier 'u'
I'm not a regular season specialist myself, but trypreg_replace('/[^a-zа-я\d\s]/', '', $string)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question