// 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)((\bprostat)(?=\w{0,3}\b))").unwrap();
let string = "/*ITALIAN*/
Neoformazione del palato duro in paziente affetto da ca della prostata.
Frustoli agoboptici di parenchima prostatico.
Il complesso dei reperti orienta in prima ipotesi per localizzazione di carcinoma di origine prostatica.
Agobiopsie prostatiche multiple
Ipertrofia prostatica.
/*ENGLISH*/
New formation of the hard palate in a patient affected by prostate cancer.
Fragments showing hypertrophic prostate parenchyma.
The combination of findings suggests a preliminary diagnosis of prostate-origin carcinoma.
Multiple prostatic core biopsies.
Prostatic hypertrophy.";
// 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/