How to choose only uppercase letters?

there is a list, OOO and a large portion of these names, well ver long
example
ЛокоТехСервисСервисноеЛокомотивноедепосарептаподразделениеволгоград1филиалюжный

so far I have the current one solution, choose current title, someone can have another idea?

And the actual reason for the creation of a topic, I don't know how to make regular expression ))
where are you, kind and sympathetic person? help plz! )))
March 19th 20 at 08:44
2 answers
March 19th 20 at 08:46
Solution
'/[A-ZА-Z]/u'
March 19th 20 at 08:48
Solution
$str = 'ЛокоТехСервисСервисноеЛокомотивноедепосарептаподразделениеволгоград1филиалюжный';
$str = preg_replace('/[^A-ZА-Z]/u', ", $str);
echo $str;

Find more questions by tags PHP