// 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)^[A-Za-z0-9+\/]{22}==$").unwrap();
let string = "/*Base64 encoded object GUID*/
z5mytpY3n0uS7WotFo0XPQ==
y1NiJQ4GvkOc6Sza75j61A==
LGRAKG1ns0u0i7HlruqP3Q==
QOrSNu771Eyc8xQ2pS1jFg==
X9wPxWuMukaZZyDBof7znw==
lQk7QUbexkGt8s6xEu0UoA==
lQk7QUbexkGt8s6xEu0UoA==
lQk7QUbexkGt8s6xEu0UoA==
FCE4wll/okm/2Hgp2cdmMg==
qAzTWmiXT0SHg2sh9h2r8g==
ksVRSMPQhEGrcm6giubf1w==
2BB+XUPh/0mdSrk7tcoi9g==
PtsmDdnwwkKMIOpifql3EQ==
10hez6mxQk+PGIwoNvIzWg==
sr9hU+51nUClfMW/rs6Sog==
zqVrydHA/UqX1OH+TZaaNg==
mL5TJlQ2U0euhNgPXRKcyA==
z5mytpY3n0uS7WotFo0XPQ==";
// 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/