// 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)((?i)DATE\s*(?i)AUTHOR\s*(?i)DESCRIPTION\s*)()").unwrap();
let string = "/***********************************************************************************************
PROCEDURE: DEL_ABCD_Table1
PARAMETERS: Sample int
APPLICATION: ABCD
PURPOSE: Deletes all records from the Table1
NOTES:
MODIFIED
DATE AUTHOR DESCRIPTION
---------- -------------- -------------------------------------------------------------
08/08/2012 Jim Initial Version
09/25/2014 Pam Adding Canvas
09/11/2018 Dwight Adding rootbeer
12/24/2019 Angela Adding Catnip
**********************************************************************************************/ ";
// 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/