Opencaching International > General discussion

Regular expression for usernames



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,

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.


[0] Themen-Index

Zur normalen Ansicht wechseln