Permalink
Browse files

Merge pull request #361 from rlipman/roles-hyphen-bugfix

Escape the hyphens in the roles regexes
  • Loading branch information...
2 parents 7f94fe0 + 841dde3 commit 4571d541ade89f8fccec1ff2b2c851c1ffb6eb6e @technicalpickles technicalpickles committed Oct 27, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/scripts/roles.coffee
View
@@ -15,7 +15,7 @@ module.exports = (robot) ->
getAmbiguousUserText = (users) ->
"Be more specific, I know #{users.length} people named like that: #{(user.name for user in users).join(", ")}"
- robot.respond /who is @?([\w .-]+)\?*$/i, (msg) ->
+ robot.respond /who is @?([\w .\-]+)\?*$/i, (msg) ->
joiner = ', '
name = msg.match[1].trim()
@@ -39,7 +39,7 @@ module.exports = (robot) ->
else
msg.send "#{name}? Never heard of 'em"
- robot.respond /@?([\w .-_]+) is (["'\w: -_]+)[.!]*$/i, (msg) ->
+ robot.respond /@?([\w .\-_]+) is (["'\w: \-_]+)[.!]*$/i, (msg) ->
name = msg.match[1].trim()
newRole = msg.match[2].trim()
@@ -63,7 +63,7 @@ module.exports = (robot) ->
else
msg.send "I don't know anything about #{name}."
- robot.respond /@?([\w .-_]+) is not (["'\w: -_]+)[.!]*$/i, (msg) ->
+ robot.respond /@?([\w .\-_]+) is not (["'\w: \-_]+)[.!]*$/i, (msg) ->
name = msg.match[1].trim()
newRole = msg.match[2].trim()

0 comments on commit 4571d54

Please sign in to comment.