From ab94b5ca7af0b5b4ca9bebfa16f80f93a5d6c76c Mon Sep 17 00:00:00 2001
From: Wim <wim@42.be>
Date: Mon, 5 Mar 2018 20:56:33 +0100
Subject: [PATCH] Update regex for usergroup matching. Closes #379

---
 bridge/slack/slack.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go
index 4d128415..a42c7e78 100644
--- a/bridge/slack/slack.go
+++ b/bridge/slack/slack.go
@@ -368,7 +368,7 @@ func (b *Bslack) replaceChannel(text string) string {
 
 // @see https://api.slack.com/docs/message-formatting#variables
 func (b *Bslack) replaceVariable(text string) string {
-	results := regexp.MustCompile(`<!((?:subteam\^)?[a-zA-Z0-9]+)(?:\|(.+?))?>`).FindAllStringSubmatch(text, -1)
+	results := regexp.MustCompile(`<!((?:subteam\^)?[a-zA-Z0-9]+)(?:\|@?(.+?))?>`).FindAllStringSubmatch(text, -1)
 	for _, r := range results {
 		if r[2] != "" {
 			text = strings.Replace(text, r[0], "@"+r[2], -1)