// 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)^ActiveCampaign\/email").unwrap();
let string = "activecampaign/email/dp philippines newsletter 10apr2019
ActiveCampaign/email/The Cube Pattaya TH-EN ALL 22AUG19/Luxury Condo Development in Pattaya, Thailand
ActiveCampaign/email/Samui Beachfront Villas TH-EN Group TH-EN MAY19 (Tide Samui)/Beachfront Villas in Koh Samui with Private Pool";
// 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/