MCPcopy
hub / github.com/crowdsecurity/crowdsec / stripAnsiString

Function stripAnsiString

cmd/crowdsec-cli/clisupport/support.go:88–91  ·  view source on GitHub ↗
(str string)

Source from the content-addressed store, hash-verified

86var reStripAnsi = regexp.MustCompile("[\u001B\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))")
87
88func stripAnsiString(str string) string {
89 // the byte version doesn't strip correctly
90 return reStripAnsi.ReplaceAllString(str, "")
91}
92
93type cliSupport struct {
94 cfg csconfig.Getter

Callers 8

dumpMetricsMethod · 0.85
dumpHubItemsMethod · 0.85
dumpBouncersMethod · 0.85
dumpAgentsMethod · 0.85
dumpLAPIStatusMethod · 0.85
dumpCAPIStatusMethod · 0.85
dumpPAPIStatusMethod · 0.85
dumpMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…