我认为,这是一个非常个人的问题,但由于我正在设计如何允许我的网站上的用户名使用结构和特性,我开始思考,我是否太严厉? 什么应该受到限制,什么不是?
这是我的用户名规则:
- must begin with a-z A-Z
- a-z A-Z 0-9 . _ is allowed
- must be between 3 - 20 characters
- Cannot end in a space
- Cannot contain two spaces in a row
- Must begin with a-zA-Z0-9 after the space
What is generally a good aspect of the username? Am I too harsh? Am I to stricted? Should I let other characters after spaces, etc.
如果有人感兴趣的话,这是我的reg:
/^(?=.{3,20}$)[a-zA-Z][a-zA-Z0-9_.^]*(?: [a-zA-Z0-9]+)*$/