Accepted webhook pattern matching?



I’m having a problem with two similarly named webhooks (in a hipchat descriptor) not firing their respective functions properly.

I’ve got 2 hooks defined as so:

      "url": "",
      "pattern": "^/[aA][cC][kK]",
      "event": "room_message",
      "authentication": "jwt",
      "name": "ack"
      "url": "",
      "pattern": "^/[aA][cC][kK][cC][sS]",
      "event": "room_message",
      "authentication": "jwt",
      "name": "ackcs"

When I call /ackcs both functions fire, i see why this could be happening and i’ve tried:

This doesnt return anything and just breaks


This doesnt return anything and just breaks


This doesn’t return anything and just breaks


can someone please advise what will match the slash commands /ack and /ackcs explicitly? Thanks!


Hey @oepstein,

Can you try the following regex:



No dice. When using the regex you provided, neither function fires. I cant understand why it doesnt like that \b?



Don’t try to do all of the heavy lifting with RegEx. You’ll hate life if you do that. If it were me I’d set up one webhook for both patterns. Here’s what my logic would look like in Node.js using ACE-HipChat:'/ack_by_text',
    function (req, res) {
        var message = req.body;
        var status = 204; 
        if (message.toLowerCase() === "/ack") {
        } else if (message.toLowerCase() === "/ackcs") {
        } else {
          status = 404;


Thats an interesting way to do that, just listening to the room and processing the message. I do this in a bunch of other places based on the actual message thats left after the slash command. When I process the message after the slash command, its because that slash command has already called the proper function to parse the message.

I agree, regex always makes me hate life. But I thought this was all supposed to happen in the capabilities descriptor, which is why Im trying to get it to work like that. Is there any way you know of making it work from the pattern match in the descriptor?