fn main() {
let input = "What??? Why?? How?????";
// Create a regex pattern to match one or more consecutive question marks
let re = regex::Regex::new(r"\?+").unwrap();
// Replace all matches with a single '?'
let result = re.replace_all(input, "?");
println!("{}", result);
}
/*
run:
What? Why? How?
*/