mirror of
https://github.com/charmbracelet/gum
synced 2024-06-26 17:20:16 +02:00
11 lines
246 B
Go
11 lines
246 B
Go
package ansi
|
|
|
|
import "regexp"
|
|
|
|
var ansiEscape = regexp.MustCompile(`\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])`)
|
|
|
|
// Strip strips a string of any of it's ansi sequences.
|
|
func Strip(text string) string {
|
|
return ansiEscape.ReplaceAllString(text, "")
|
|
}
|