by axew3 » Mon Nov 23, 2020 1:45 pm
Code: Select all
SELECT username FROM users WHERE username REGEXP [^-0-9A-Za-z _.@]
will detect
Денис И. as containing unwanted characters, even if it do not contain unwanted characters, based on above regexp,
Денис И. 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:] _.@]
MySQL reference:
https://dev.mysql.com/doc/refman/8.0/en/regexp.html
Any other i've try fail, but if anybody know how could be possible to achieve the same in different way please let know!
[code]SELECT username FROM users WHERE username REGEXP [^-0-9A-Za-z _.@][/code]
will detect [b]Денис И.[/b] as containing unwanted characters, even if it do not contain unwanted characters, based on above regexp,
Денис И. in non Cyrillic, but in Latin chars it is [b]Denis I.[/b] and so should be accepted as valid.
To resolve this issue, i've find out into MySQL documentation a possible easy solution, because [i][b]alnum[/b][/i] (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 username FROM users WHERE username REGEXP [^-[:alnum:] _.@][/code]
MySQL reference: [url]https://dev.mysql.com/doc/refman/8.0/en/regexp.html[/url]
Any other i've try fail, but if anybody know how could be possible to achieve the same in different way please let know!