Regular expression for usernames

Ideas and plans to talk about
Antworten
oliver

Hi,

a user noticed that usernames like -user- are not allowed at the moment.
So i updated the regular expression to allow usernames begin with all chars that are allowed at the rest of the username (except whitespace).

Here is the old and new regex:
define('REGEX_USERNAME', '^[a-zA-Z0-9][a-zA-Z0-9\.\-_ @äüöÄÜÖ=)(\/\\\&*+~#]{2,59}$');
define('REGEX_USERNAME', '^[a-zA-Z0-9\.\-_@äüöÄÜÖ=)(\/\\\&*+~#][a-zA-Z0-9\.\-_ @äüöÄÜÖ=)(\/\\\&*+~#]{2,59}$');

I plan to update the webserver in a few days.
If you have an idea for further modification or if you see any problem with the modification, it is the right time to talk about it :)


Kind regards,
Oliver
OlofL

If I understand the regexp correct there are probably more regional characters that should be allowed. The nordic characters åÅøØæÆ should be allowed. Ask sp2ong which polish characters should be allowed.
Antworten