Mentioning do not work when username ends with `.` and other special characters
Or change username policies to not let usernames starts or finish with dot.
Updated: Looks like the problem is not related only to dots:

@RocketChat/owners I guess the question we need to answer first is, do we want usernames ending in non alphanumeric characters?
I personally dislike usernames ending in a period or dash. I find it confusing.
Ex: Hey have you seen @ninja. around?
That's just my two cents.
I agree with you guys.. we should not accept usernames ending with non alphanumeric characters.
From a new user who is looking into this for his company perspective I agree with geekgonecrazy, ending in special characters could cause confusion (common punctuation more than others).
Hi there @user, how are you?
Am I speaking to @user and using proper punctuation or am I skipping punctuation and talking to @user,
problem is the algorithm which suggests new usernames if they are taken and that adds a dot
@ninja- correct. That's why I ask. Cause we either fix this and continue to allow this or make tweaks to username creation.
What about UTF-8 usernames, especially for Chinese , Japanese and Korean,
发自我的 iPhone
在 2015年10月6日,上午12:11,Diego Sampaio [email protected] 写道:
I agree with you guys.. we should not accept usernames ending with non alphanumeric characters.
— Reply to this email directly or view it on GitHub.
Thats a good point @steedos, we have to create a global UTF-8 REGEX for usernames and channels that takes that in consideration.
@ninja- are you having problems with this?
@engelgabriel , changed my username to remove a dot. Algorithm which replaced my github username from ninja- to ninja. has a room for improvement
Note that this issue also applies if the username does not end in a period.

@kyrofa yeah it looks like we need to get our regex around username matching fixed asap..
Adding a space as a valid character in the regex breaks the mentioning completely when using the autocomplete
if node.js supported negative lookbacks with regex this would be as easy as appending (?<![\.]) to the regexp.
Works in chrome, but does not work in node 8 or probably other browsers.
@thef1sh if adding a space as a valid character breaks the autocomplete, then space should simply be a forbidden character when creating your nickname.
@ChameleonScales With Custom OAuth and Office 365, your only options for user names are "Full Name" or "[email protected]", both of which break mentions. Not sure if I should open another ticket for having an @ in the username breaking mentions as well, or just mention it here.
but just why even allow a character that breaks a feature ? When you put a slash / in a filename inside a folder, you get a popup telling you that you can't do that, and you have to change the name. To me that's how it should behave. In the rocket.chat server I use, 90% of users have a space in their name because they're unaware of the consequences. That's a pity.
@ChameleonScales because the custom OAuth module has no way to mangle data it receives from the oauth server to remove "illegal" characters?
@ChameleonScales @sketch242 Current "Names Validation" regexp is also used for channels and groups. Therefore you either have mentions working and no spaces, dots, commas, etc.. in usernames, groups and channels. Or you ignore mentions and everything else is working.
I'm not sure if mentions for complex usernames will ever be implemented but at least maybe it is possible to separate those regexes.
@sketch242 I'm not talking about removing a character or mangling any data. My request is that when you click OK when creating your username, before actually validating, some script would first check if there's a space in your name and if there is, it would not validate and show a message telling you why. Of course everyone who already has a space in their name won't be affected by that. This is just for future newcomers. Do you think this would be doable ?
