summaryrefslogtreecommitdiff
path: root/vendor/github.com/acarl005/stripansi/stripansi.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-02-05 18:14:53 +0100
committerGitHub <noreply@github.com>2020-02-05 18:14:53 +0100
commitfc0673f5612368e0d90173bb061f4b257d08b885 (patch)
tree2a7146aa7fd8b18190523eb2211d90c61e97fac8 /vendor/github.com/acarl005/stripansi/stripansi.go
parent107fd64970faa5870a4c23c971f5061e57b99067 (diff)
parentbaec9f3b10faa4f319b92549ea460aba0af91a4d (diff)
downloadpodman-fc0673f5612368e0d90173bb061f4b257d08b885.tar.gz
podman-fc0673f5612368e0d90173bb061f4b257d08b885.tar.bz2
podman-fc0673f5612368e0d90173bb061f4b257d08b885.zip
Merge pull request #5062 from vrothberg/update-image
vendor github.com/containers/image/v5@v5.2.0
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, "")
+}