Navigation Menu

Skip to content

Commit

Permalink
User.is_nick utility
Browse files Browse the repository at this point in the history
  • Loading branch information
dsamarin committed Jul 9, 2012
1 parent d04a75a commit a7fc803
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions petal/irc/User.js
Expand Up @@ -14,6 +14,10 @@ var User = function(nick, op, halfop, voice) {
this.voice = voice;
};

User.is_nick = function(nick) {
return /^[A-Z\[\\\]\^_`{|}][-0-9A-Z\[\\\]\^_`{|}]{,15}$/i.test(nick);
};

User.parse = function(prefix) {
var match = prefix.match(/^:?(.*)!(\S+)@(\S+)/);
if (match) {
Expand Down

0 comments on commit a7fc803

Please sign in to comment.