// include the latest version of the regex crate in your Cargo.toml
extern crate regex;
use regex::Regex;
fn main() {
let regex = Regex::new(r"(?im)^(?![\s'-])(?:[\s'-]{0,1}[\p{L}])+$").unwrap();
let string = "Masion
Délire
Vértige
Ma-Maison-Heueuse
Libre de Vivre
Combat d'El Toro
Mire er
L'école des Mimosa
sephorù
Владимир
Владими ладим
sephorù
中華人民共和國
Nippon-koku ou Nihon-koku
日本国
جزيرة العرب
Sephora55
55789
?yuiy
(hjk)
sephoraö
";
let substitution = "";
// result will be a String with the substituted value
let result = regex.replace_all(string, substitution);
println!("{}", result);
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Rust, please visit: https://docs.rs/regex/latest/regex/