• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 How To Keep Usernames In Check While Registration?

Divvens

Well-known member
#1
I wish to not allow special characters like Japanese Kanji/Special English characters (Spanish letters that have a special o, e etc) on usernames during registration.

I want to allow: Numericals, alphabets, underscores and - , spaces.

Is this possible? I don't mind having all special characters unusable apart from just underscore too.
 

Divvens

Well-known member
#3
Enter the regex you want to use in the User Name Match Regular Expression field.
For example: ^[a-zA-Z0-9_ ]+$
Ah regex, thanks. I don't know about it, so I'll look it up, but is the regex you posted for alphabets, numerics & underscore?
 

rafass

Well-known member
#7
Just curious, what's the reason to don't allow this kind of weird characters in the username?
It could cause future problems in the tables or something?
 

Divvens

Well-known member
#9
Just curious, what's the reason to don't allow this kind of weird characters in the username?
It could cause future problems in the tables or something?
For us, it makes it very difficult for users to use the @mention feature if the username starts with special characters that cannot be typed by a default (vanilla) keyboard. It just takes out that bit of the community experience and interaction with said user gets a bit difficult, so we want to maintain usernames without special characters.