// 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"(?mi)(fg\w+)?(\s)?(\d+|\w+)([\/\._]+\w+)([\/\._ ]?)(\d+)(\w?)").unwrap();
let string = "Trans 16 10.2/300 Vor-, täglich
InnoTrans 16 Reinigung 23/705 Vorr./Tägl.
InnoTrans 16 Reinigung 17/113 Vorr./Tägl.
FUNK 16 Reinigung 14.1/124 Vorr./Tägl.
InnoTrans 16 Reinigung FGSUED O/240 Vorr./Tägl.
InnoTrans 16 Reinigung 6.2/507 Vorr./Tägl.
Trans 16, 23/606, Vor + tägl. Reinigung
InnoTrans 16 Reinigung 26./141 Vorr./Tägl.
InnoTrans 16 Reinigung FGSUED O/553 Reinigung Aufbau+Gl./Tägl.+Gl.
Inno 16 Vorr. + tägl. Rein. H. 17_304
trans 4.1 412 vor u tä
InnoTrans 16 Reinigung FGSUED T10/47 Reinigung nach Stundennachweis
Inno 16 Vorr. + tägl. rein. H. 7.2C_305
Inno 16 - Storno H. 22_808
STORNO !!!!!!InnoTrans 16 Reinigung 4.2/208a Vorr./Tägl.
innotrans 16 reinig tä 21. 205";
// 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/