// 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"(?i)\/o\/([a-zA-Z0-9]+)\/([a-zA-Z0-9-]+)").unwrap();
let string = "https://firebasestorage.googleapis.com/v0/b/geographical-memories-dev.appspot.com/o/Fa4NPIoM5sON70uDJjufgnL5DHY2/01792dcc-4963-4658-a3d0-99073b352e22?alt=media&token=23676a66-ed8d-4b43-9150-6ef3f07544f0
https://firebasestorage.googleapis.com/v0/b/geographical-memories-dev.appspot.com/o/Fa4NPIoM5sON70uDJjufgnL5DHY2/01792dcc-4963-4658-a3d0-99073b352e22?alt=media&token=80a5cc0f-7943-4ef8-ab00-9bef8acd41bf";
// 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/