1π
- βLATIN SMALL LETTER C is not considered to be the same as βCYRILLIC SMALL LETTER ESβ.
- Ditto for βCYRILLIC SMALL LETTER Iβ and βCYRILLIC SMALL LETTER SHORT Iβ
- MySQLβs
REGEXP
works with bytes not characters. hence only unaccented English letters work inREGEXP
; no Cyrillic letter can (reliably) work. - MariaDB 10.0.5βs
REGEXP
should do a better job. Ref: https://mariadb.com/kb/en/mariadb/pcre/
π€Rick James
0π
I suggest switching to Postgres database which handles non-latin symbols pretty good.
Just tried to reproduce your issue on my Django 1.10 and Postgres 9.6 setup.
from django.contrib.auth.models import User
users = User.objects.filter(username__iregex='Π‘ΠΎΡΠ½ΠΈΡΠΊΠΈ(ΠΈ|ΠΉ)')
users
<QuerySet [<User: Π‘ΠΎΡΠ½ΠΈΡΠΊΠΈΠΉ>, <User: ΡΠΎΡΠ½ΠΈΡΠΊΠΈΠΉ>, <User: ΡΠΎΡΠ½ΠΈΡΠΊΠΈΠΈ>, <User: Π‘ΠΎΠ‘Π½ΠΈΡΠΊΠΈΠΈ>]>
Seems to be working.
π€Nik
Source:stackexchange.com