// 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"(?m).*\/(en|nl|fr|de|es|fi|it|tr|cs|da|no|sv|pt)\/(free|gratis|generateur|kostenloser).*\-(generator|gratuit)").unwrap();
let string = "https://www.voicebooking.com/en/free-voice-over-generator
https://www.voicebooking.com/nl/gratis-voice-over-generator
https://www.voicebooking.com/fr/generateur-voix-off-gratuit
https://www.voicebooking.com/de/kostenloser-voice-over-generator
https://www.voicebooking.com/es/free-voice-over-generator
https://www.voicebooking.com/fi/free-voice-over-generator
https://www.voicebooking.com/it/free-voice-over-generator
https://www.voicebooking.com/tr/free-voice-over-generator
https://www.voicebooking.com/cs/free-voice-over-generator
https://www.voicebooking.com/da/free-voice-over-generator
https://www.voicebooking.com/no/free-voice-over-generator
https://www.voicebooking.com/sv/free-voice-over-generator
https://www.voicebooking.com/pt/free-voice-over-generator
";
// 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/