Fix typos in channel.jade; fix username regex
This commit is contained in:
parent
c213dd1374
commit
5fe5dd440e
2 changed files with 17 additions and 4 deletions
|
|
@ -32,13 +32,26 @@ Set.prototype.forEach = function (fn) {
|
|||
}
|
||||
};
|
||||
|
||||
var USERNAME_REGEX = new RegExp(
|
||||
"^[-\\w" + // Hyphen and a-zA-Z0-9_
|
||||
"\\u00c0-\\u00c5" + // Uppercase A
|
||||
"\\u00c7-\\u00cf" + // Uppercase C, E and I
|
||||
"\\u00d1-\\u00d6" + // Uppercase N and O
|
||||
"\\u00d9-\\u00dd" + // Uppercase U and Y
|
||||
"\\u00e0-\\u00e5" + // Lowercase A
|
||||
"\\u00e7-\\u00ef" + // Lowercase C, E anf I
|
||||
"\\u00f1-\\u00f6" + // Lowercase N anf O
|
||||
"\\u00f9-\\u00ff" + // Lowercase U anf Y
|
||||
"]{1,20}$"
|
||||
);
|
||||
|
||||
module.exports = {
|
||||
isValidChannelName: function (name) {
|
||||
return name.match(/^[\w-_]{1,30}$/);
|
||||
},
|
||||
|
||||
isValidUserName: function (name) {
|
||||
return name.match(/^[-\w\u00c0-\u00ff]{1,20}$/);
|
||||
return name.match(USERNAME_REGEX);
|
||||
},
|
||||
|
||||
isValidEmail: function (email) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue