From b7a8c6b60fbb9c26db7b427bcf95332efc697ba7 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 28 Oct 2017 14:28:15 +0200 Subject: Try again to strip colors correct. #286 --- bridge/irc/irc.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go index 2c8c09a4..e4fc0680 100644 --- a/bridge/irc/irc.go +++ b/bridge/irc/irc.go @@ -288,9 +288,7 @@ func (b *Birc) handlePrivMsg(event *irc.Event) { } msg += event.Message() // strip IRC colors - re := regexp.MustCompile(`\x03(\d+,|)\d+`) - msg = re.ReplaceAllString(msg, "") - re = regexp.MustCompile(`[[:cntrl:]]`) + re := regexp.MustCompile(`[[:cntrl:]](?:\d{1,2}(?:,\d{1,2})?)?`) msg = re.ReplaceAllString(msg, "") var r io.Reader -- cgit v1.2.3