I'm using such pattern to find cyrillic symbols in my text, but it is returning true on unicode currency symbols "₴" (ukrainian hryvnya) and "€" (euro)
$pat = '/.*[А-Яа-яёЁ].*/';
$res = preg_match($pat, $str);
What is the problem?
I'm using such pattern to find cyrillic symbols in my text, but it is returning true on unicode currency symbols "₴" (ukrainian hryvnya) and "€" (euro)
$pat = '/.*[А-Яа-яёЁ].*/';
$res = preg_match($pat, $str);
What is the problem?
You should make your pattern unicode-aware with
/u
modifier:Quoting the doc:
Demo. BTW, if you only check whether or not cyrillic letters are present in the string without doing anything on the match (and with the given code you do), you can drop
.*
parts from your pattern.