// 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)\(\(\(?([^}]*?)\)\)\)").unwrap();
let string = "((Short Title (in Navigation & Breadcrumb))) Pflanzen & Samen
((Post-Text)) Hast du unser Osterschoggi-Sortiment schon probiert? ((Schleckmaul))
[Ceci est un ((non visible)) (test)]
[[Ceci est un ((non visible)) (test)]]
Ceci est un [[visible ((non visible))]] (test)
Ceci est un ((non visible [non visible])) (test)
((Headline))
((non visible))
Ceci doit être traduit
((Sternchentext))
*Mit Cashback Fr. 39.90, Rückvergütung (Überweisung) einlösbar unter canon.ch/summer, gültig von 15.2. bis 15.5.2021 ((maximal 140 Zeichen inkl. Leerzeichen))
Lieferung per Paketkurier (Direktlieferung (normal))
";
// 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/