This commit is contained in:
Daisuke Maki 2014-07-24 21:03:01 +09:00
parent 374f85ebde
commit 2271f0c75a

View file

@ -9,11 +9,11 @@ import (
)
// Global var used to strips ansi sequences
var ansiStrips = regexp.MustCompile("\x1B\\[(?:[0-9]{1,2}(?:;[0-9]{1,2})?)*[a-zA-Z]")
var reANSIEscapeChars = regexp.MustCompile("\x1B\\[(?:[0-9]{1,2}(?:;[0-9]{1,2})?)*[a-zA-Z]")
// Function who strips ansi sequences
func stripANSISequence(s string) string {
return ansiStrips.ReplaceAllString(s, "")
return reANSIEscapeChars.ReplaceAllString(s, "")
}
// Match defines the interface for matches. Note that to make drawing easier,