I need to replace all cyrillic characters to the latin equivalents between "[]" brackets. Here is the example:
Приметимо да
формула (\ref{ј5121}) обухвата
и случајеве а) и б).
Заиста, из (\ref{ј5121}), за $x_1=x_2$
добија се:
\[
|АБ|=\sqrt{(y_2-у_1)^2}=|y_2-п_1|,
\]
а из (\ref{ј5121}), за $y_1=y_2$:
\[
|AЦ|=\sqrt{(м_2-х_1)^2}=|н_2-x_1|.
\]
Стога се формула (\ref{ј5121}) може
применити на било које
двe тачке, без обзира
на њихов положај.
I've managed to isolate the content between the brackets with this code: $pattern = "/[([^)]*)]/"; preg_match_all($pattern, $string, $output);
But I just can't make it replace cyrillic characters with latin ones :\ Any kind of help is welcome. Thanks!