// 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)https://internetinthecar-e2e\.((sfr|a1|swisscom|proximus|elisa|tango|telenor-no|telenor-se|yousee|plus|telia|bite-lv|bite-lt|a1-)\.)?iot\.vodafone\.com/sso/authorize/callback|https://internetinthecar-e2e-new\.iot\.vodafone\.com/sso/authorize/callback").unwrap();
let string = "(https://internetinthecar-e2e.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.sfr.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.a1.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.swisscom.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.proximus.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.elisa.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.tango.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.telenor-no.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.telenor-se.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.yousee.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.plus.iot.vodafone.com/sso/authorize/callback|https://internetinthecar-e2e.telia.iot.vodafone.com/sso/authorize/callback)
https://internetinthecar-e2e.bite-lv.iot.vodafone.com/sso/authorize/callback
internetinthecar-e2e.bite-lt.iot.vodafone.com
internetinthecar-e2e.a1-si.iot.vodafone.com
internetinthecar-e2e.cyta.iot.vodafone.com
internetinthecar-e2e.elisa-ee.iot.vodafone.com
internetinthecar-e2e.epic.iot.vodafone.com
internetinthecar-e2e.a1-hr.vodafone.com
internetinthecar-e2e.a1-bg.iot.vodafone.com
";
// 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/