Answer the question
In order to leave comments, you need to log in
Why doesn't preg_replace react to Cyrillic?
Why doesn't preg_replace react to Cyrillic?
$str = 'Сссссууууууупппппппеееееерррррр!!!!!! SuuPpEEr!';
echo preg_replace('~(.)\1+~i', '\\1', $str);
// вывод:
// Сссссууууууупппппппеееееерррррр! SuPEr!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question