From 299b71d98202b40365af063a886c7a2cf66582bc Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 26 Oct 2017 23:04:44 +0200 Subject: [PATCH] Strip irc colors correct, strip also ctrl chars (irc). Closes #286 --- bridge/irc/irc.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go index 3276eab5..2c8c09a4 100644 --- a/bridge/irc/irc.go +++ b/bridge/irc/irc.go @@ -288,7 +288,9 @@ func (b *Birc) handlePrivMsg(event *irc.Event) { } msg += event.Message() // strip IRC colors - re := regexp.MustCompile(`[[:cntrl:]](\d+,|)\d+`) + re := regexp.MustCompile(`\x03(\d+,|)\d+`) + msg = re.ReplaceAllString(msg, "") + re = regexp.MustCompile(`[[:cntrl:]]`) msg = re.ReplaceAllString(msg, "") var r io.Reader