• Welcome to XF2 Addons

    You can purchase a Premium membership for only $35 per year, and this gives you access to download any or ALL of the over 400 add-ons developed for Xenforo 2.x. In addition, Premium members will get technical support. Once the Premium membership has expired you can continue to use the installed addons on your forum as long as you like.

Username match regular expression

Andy

Administrator
Staff member
If you would like to only allow modern English alphabet, numbers and space in usernames, you can use the "Username match regular expression" field in the admin control panel:

Admin control panel -> Setup -> Options -> User registration

1642096519726.png


Enter the following:

/^[a-z0-9 ]+$/i
 
Thank you very much, very useful.
This is my REGEX for french username

/^[a-z0-9àâäéèêëïîôöùûüÿç\- ]+$/i

i added \- to authorize compound first names which are very common in French, like Jean-Paul.
 
Thank you very much, very useful.
This is my REGEX for french username



i added \- to authorize compound first names which are very common in French, like Jean-Paul.

And I just realized an error in mine. I'm a fool. :D I wanted to allow dashes and underscores, and am probably allowing a bit too much and not what was intended. No one used it yet. :D Thank you!
 
Back
Top