summaryrefslogtreecommitdiff
path: root/vendor/github.com/acarl005/stripansi/stripansi.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/acarl005/stripansi/stripansi.go')
-rw-r--r--vendor/github.com/acarl005/stripansi/stripansi.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/github.com/acarl005/stripansi/stripansi.go b/vendor/github.com/acarl005/stripansi/stripansi.go
new file mode 100644
index 000000000..235732a78
--- /dev/null
+++ b/vendor/github.com/acarl005/stripansi/stripansi.go
@@ -0,0 +1,13 @@
+package stripansi
+
+import (
+ "regexp"
+)
+
+const ansi = "[\u001B\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"
+
+var re = regexp.MustCompile(ansi)
+
+func Strip(str string) string {
+ return re.ReplaceAllString(str, "")
+}