// 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)(2|3)").unwrap();
let string = "superscript
(?<=m)(2|3)
®|™
(?<=\\d)(de|ème)
REF
\\d{6}/(D|T|X)
REF2
\\d{3}/(D|T|X)
REF3
\\d{6}(?-)
VET
garantie[^\\r\\n]+jaar
Fraction
\\b1/2\\b
PARQUET STRATIFIE ‘MEGALOFT’
Différents motifs
Longueur 1286mm x largeur
194mm
10000kcal/u
25mm2
10dm3 10dm3/u
1000m3/u
850l/u
1000m3/h
850l/h
1,99m2/pak
1,33m3
1,25m2
25kg
700559/D
1,59m3/pak
1,996m2/paquet
700496-123566-123/D
1,996m2/paquet
123566-123/D
1,99m2 en 199m3/h
135234-123/D
Gerst 004729/D
Schors 058157/D
Ø 30/60 x H230cm
Polyester doek 280gr/m2
Crossover®-ontstekingssysteem
™ Toelatingsnr: 3001B
32/38mm slang
ZANDFILTERKIT 10m3/u
Debiet 1,2m2/u
Zinklaag: 180-250gr/m2
2de handgreep
2ème poignon
Garantie 25 jaar
10 jaar waarborg
Maaihoogteregeling 20-75mm
Gerst 004729/D
Schors 058157/D
Ø 30/60 x H230cm
Polyester doek 280gr/m2
Crossover®-ontstekingssysteem
™ Toelatingsnr: 3001B
32/38mm slang
ZANDFILTERKIT 10m3/u
Debiet 1,2m2/u
Zinklaag: 180-250gr/m2
2de handgreep
2ème poignon
garantie 25 jaar
garantie 25 jaar
Garantie 25 ans jar
Jaar Garantie 25
25 jaar garantie
10 jaar waarborg
Maaihoogteregeling 20-75mm
1/2
®
541358/9/60
541358-12-12/D
541358-123-123/D
541358-1234-1234/D
541358-12345-12345/D
541358-123456-123456/D";
// 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/