Answer the question
In order to leave comments, you need to log in
Why is preg_replace not working correctly in php?
I use this regular expression to clean up Cyrillic: https://regex101.com/r/NQQXSN/1
Judging by the site, everything works OK, it finds what it needs.
I use in code:
$string = '157AF0_УЦЕНКА';
preg_replace('/[\x{0410}-\x{042F}]+.*[\x{0410}-\x{042F}]+/iu', '', $string);
dump($string); // output "157AF0_УЦЕНКА"
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