rust using regex in if statement
use regex::Regex;
fn are_you_playing_banjo(name: &str) -> String {
format!("{} {} banjo", name, if Regex::new(r"^[rR]").unwrap().is_match(name) {"plays"} else {"does not play"})
}
// Instead of a normal parameter, the 'if' returns the result of a regex match.