// 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)^((?!\.doc).)*$").unwrap();
let string = "256a5037-9fc1-4e60-95c3-523d5ae1c935/foo/44434038019,2019-05-24T09:02:18.695Z,b4786bf4-157a-4f1b-a030-4c5416e1884a
256a5037-9fc1-4e60-95c3-523d5ae1c935/bar/44434038019,2019-05-24T09:02:18.695Z,b4786bf4-157a-4f1b-a030-4c5416e1884a
govcorp/123a5037-9fc1-4e60-95c3-523d5ae1c935/foo/text.doc
156a5037-9fc1-4e60-95c3-523d5ae1c935/123a5037-9fc1-4e60-95c3-523d5ae1c935/foo/text.doc
123a5037-9fc1-4e60-95c3-523d5ae1c935/";
// 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/