// 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"(^|\b|\W)([PpРр9]+[UuÙÚÛÜùúûü]+[TtТт7]+[AaÀÁÂÃÄÅĄàáâãäåąАаДд4@ª]+)(s?)($|\b|\W)").unwrap();
let string = "putá el que lo lea putaaaááÁÁaaaa:puta🍕. hijo-de-puuta: Esto es una putada. pupupuputa puto
Pu7äs every where.PUTAPuTAaaa-PûTA. Había unos cuantos hijos de puutaááaaó puta
lalal putaaa7 que te put@sñññ que (puta) eres. puta puta puta
Reputados réputaçión -> la é y la ç son \\W
Padre putativo
";
// result will be an iterator over tuples containing the start and end indices for each match in the string
let result = regex.captures_iter(string);
for mat in result {
println!("{:?}", mat);
}
}
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/