XF 2.2 Prohibit username characters

Thanks for the help. But how do you make it possible to use only Latin letters, so that no one registers with Arabic, Russian or any such language? On phpbb there was a system I do not remember what it was called and there you could choose which language you could just register in.
 
Admin control panel -> Setup -> Options -> User registration

1615411019161.png

That will allow letters and numbers.

/^[a-z0-9]+$/i

That will allow letters, numbers and a space.

/^[a-z0-9 ]+$/i
 
Last edited:
I use this one:
/^[a-z0-9-_[\] .:<=>]+$/i

This will allow, letters, numbers, but also spaces, underscore, minus - and some other characters like < = and > and : and dot.
Adjust as you like. But it might be nice for users to be able to use a name with spaces at least.
 
I use this one:
/^[a-z0-9-_[\] .:<=>]+$/i

This will allow, letters, numbers, but also spaces, underscore, minus - and some other characters like < = and > and : and dot.
Adjust as you like. But it might be nice for users to be able to use a name with spaces at least.
characters such as: - _. is good to have but the rest I do not want. The other day there was someone who registered with € king! & Which is very disturbing. But what about registration with other characters, Chinese, Arabic or Indian? Is it possible to register with those languages and if it is possible, can it be prevented? Only allow Latin that the western world uses?
 
Only allow Latin that the western world uses?
These are latin characters. I used them on IPB too when users registere with Arabic characters, which I did not want to happen.
If you use these, they should only be able to use a-z, A-Z, 0-9 space, so what is mentioned in there.
Everything which is out of that definition can not be used.

So if you want -_ space and dot, this should do the trick for you.
/^[a-z0-9-_ .]+$/i
this will also prevent them from registering with [ and/or ] characters and : or other characters can't be used either.

You can also check this link which I got from Brogan when I had this question. It's to test regexp and see what it does.
 
These are latin characters. I used them on IPB too when users registere with Arabic characters, which I did not want to happen.
If you use these, they should only be able to use a-z, A-Z, 0-9 space, so what is mentioned in there.
Everything which is out of that definition can not be used.

So if you want -_ space and dot, this should do the trick for you.
/^[a-z0-9-_ .]+$/i
this will also prevent them from registering with [ and/or ] characters and : or other characters can't be used either.

You can also check this link which I got from Brogan when I had this question. It's to test regexp and see what it does.
Which character in that regex allows a space in the name?
 
Top Bottom