diff options
Diffstat (limited to '')
-rw-r--r-- | dependencies/pkg/mod/github.com/acarl005/stripansi@v0.0.0-20180116102854-5a71ef0e047d/stripansi.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dependencies/pkg/mod/github.com/acarl005/stripansi@v0.0.0-20180116102854-5a71ef0e047d/stripansi.go b/dependencies/pkg/mod/github.com/acarl005/stripansi@v0.0.0-20180116102854-5a71ef0e047d/stripansi.go new file mode 100644 index 0000000..235732a --- /dev/null +++ b/dependencies/pkg/mod/github.com/acarl005/stripansi@v0.0.0-20180116102854-5a71ef0e047d/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, "") +} |