// 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"(?s)PAS_BEGIN_0009999(.*?)PAS_END_0009999").unwrap();
let string = "PAS_BEGIN_0009999
T71_MANUFACTURER_4=98
T71_COLOR_ID_7=000
T71_OS_7=08
PAS_END_0009999
PAS_BEGIN_0009996
T72_VAS_SERVICE_IDENTIFIER_6=
T72_ORDER_NB_7=0003
T72_TECHNOLOGY_7=01
PAS_END_0009996
TPV_BEGIN
PAS_20819001=3600000
TPV_END";
// 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/