XF 1.5 Disable numbers usernames for registration

Nirjonadda

Well-known member
How to disable numbers usernames for registration? I want disable registration users with only numbers in username. Example: 1234

I mean the following:

Code:
Allow : Nirjonadda or nirjonadda
Allow : Nirjonadda1234 or nirjonadda1234
Disallow : 1234

I want allow numbers in usernames or any characters, but not only numbers.
 
You could consider using this: Admin - options - user registration - User Name Match Regular Expression
Code:
^[a-zA-Z_-]+$
This allows names with a-z, and A-Z and names with underscore _ and dashes -
This won't allow other characters, spaces, or numbers.
 
What does with this ? we need allow all in all without only numbers

letters and numbers, in pairs, seems to work
Screen Shot 2017-04-02 at 15.58.18.webp

numbers and letters, seems to work
Screen Shot 2017-04-02 at 15.58.05.webp
pairs of letters, seems to work
Screen Shot 2017-04-02 at 15.57.53.webp

pairs of numbers, doesn't seem to work - which is what we want.
Screen Shot 2017-04-02 at 15.57.44.webp

letters and numbers stuck together, works fine too
Screen Shot 2017-04-02 at 15.57.19.webp

numbers and letters stuck together, works great too
Screen Shot 2017-04-02 at 15.57.06.webp

all letters, yep
Screen Shot 2017-04-02 at 15.56.36.webp

all numbers, nope, doesn't work - great, it's what we want
Screen Shot 2017-04-02 at 15.56.23.webp


So user "bob" can register, and user "123bob" and user "bob123" but not user "1234"
 
So user "bob" can register, and user "123bob" and user "bob123" but not user "1234"

Code:
^(?![\d\s]+$)[a-zA-Z\d\s]+$

With this code allow all any characters without only numbers?

user "bob" can register, and user "123bob" and user "bob123" but not user "1234" but Can register with special characters?
 
a-z,A-Z, doesn't include special characters. Just replace the query with the stuff you want to include. There are a few threads on xenforo that also handle special characters.
 
Back
Top Bottom