1 2 3 4 5 6 7 8
#![allow(dead_code)] pub fn strip_ansi_codes(text: &str) -> String { regex::Regex::new(r"\x1b\[[0-9;]*m") .unwrap() .replace_all(text, "") .to_string() }