Expand description
Parses ANSI escape codes from the given text, returning a vector of Match
.
let ansi_text = "Hello, \x1b[31;4mworld\x1b[0m!";
let parsed: Vec<_> = cansi::parse(ansi_text)
.into_iter()
.map(|m| (m.start, m.end))
.collect();
assert_eq!(
parsed,
vec![(7, 14), (19, 23)],
);