We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13617b4 commit 977d407Copy full SHA for 977d407
third_party/github.com/acarl005/stripansi/stripansi.go
@@ -6,8 +6,11 @@ import (
6
7
const ansi = "[\u001B\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"
8
9
-var re = regexp.MustCompile(ansi)
+var re *regexp.Regexp
10
11
func Strip(str string) string {
12
+ if re == nil {
13
+ re = regexp.MustCompile(ansi)
14
+ }
15
return re.ReplaceAllString(str, "")
16
}
0 commit comments