Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

User.is_nick utility

  • Loading branch information...
commit a7fc803ae3a50f9f0730385fcacb38b98837e126 1 parent d04a75a
@dsamarin dsamarin authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 petal/irc/User.js
View
4 petal/irc/User.js
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.