Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment: I concur with Raymond and Eric.
Note that in general case the problem is more complex that you may expect. First, some characters can match two characters (e.g. 'ß' matches 'SS'), and therefore indexes of characters are different in different cases. Second, you may want to take to account Unicode normalization, so 'й' will match 'й' (the former is a single character, the latter is two characters 'и'+'\u0306'). The re module will not help with solving the first problem. You should use the third-party regex package. For the second problem you can use unicodedata.normalize(), ---------- nosy: +serhiy.storchaka resolution: -> rejected stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44773> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com