MySQL regexp for Latin and non Latin characters
Posted: Mon Nov 23, 2020 1:45 pm
Code: Select all
SELECT username FROM users WHERE username REGEXP [^-0-9A-Za-z _.@]
Денис И. in non Cyrillic, but in Latin chars it is Denis I. and so should be accepted as valid.
To resolve this issue, i've find out into MySQL documentation a possible easy solution, because alnum (alphabetic/numbers in place of a-zA-Z0-9) do not take care of what kind of characters it found, and manage/return the correct result in this way:
Code: Select all
SELECT username FROM users WHERE username REGEXP [^-[:alnum:] _.@]
Any other i've try fail, but if anybody know how could be possible to achieve the same in different way please let know!