New forum member has username with emoji

Not having migrated yet, I have to ask... Is there an ACP option to limit usernames to alphanumeric characters?
 
No. That will reject a decent amount of usernames. You'll want to use:
^[a-zA-Z0-9 ]+$

Your RegEx disallows lower case. ;)

But yes, such RegEx will prevent Emoji. It also removes the possibility of punctuation.
 
Glad I checked, that's different from vB. Thanks again.
If you are using that RegEx in vBulletin you should only be getting capital letters, numbers, and spaces.

The difference between yours and mine is I allow lower case.
 
I'm using mine in vB and there are no issues with lowercase registrations, but I appreciate the difference between yours and mine as it speaks to what I need (yours) on XF. Apologies for the soft hijack here, cmeinck.
 
No. That will reject a decent amount of usernames. You'll want to use:
^[a-zA-Z0-9 ]+$

Your RegEx disallows lower case. ;)

But yes, such RegEx will prevent Emoji. It also removes the possibility of punctuation.
Thanks to @wcbryant for indulging my curiosity and giving me some information about vBulletin that lead me to figuring out that both of our RegEx's will work in XenForo for the same reason his works in vBulletin. Its due to the fact that both vBulletin and XenForo utilize the Caseless flag in the RegEx.

You learn something new every day.
 
No. That will reject a decent amount of usernames. You'll want to use:
^[a-zA-Z0-9 ]+$

Your RegEx disallows lower case. ;)

But yes, such RegEx will prevent Emoji. It also removes the possibility of punctuation.

I've been using this.
^[a-z0-9]++(?:\s[a-z0-9]++)?$

The one you posted looks cleaner, much difference?
 
Not a RegEx master, that's @Mike. But a quick search of the Internet returned this for the double ++:
http://stackoverflow.com/questions/4489551/what-is-double-plus-in-regular-expressions

Probably not necessary in this case. Yours seems to enforce two words as a maximum of two words. Although you do use a non capturing group. I'll have to research it more tonight. Where did you get it?

However, mine does as it is stated above.

I think I got it here but I really don't remember.
 
Are there any real potential problems with allowing these type of chars or it's just to avoid its tackiness?
 
This is what I use:
Code:
^[A-Za-z0-9][\w\-\.\s]+[A-Za-z0-9]$

Must START/END with an alpha-numeric.
Can contain alpha-numeric, _ - . and space.
 
Back
Top Bottom