// 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"\b(?:v(?:s?\.|:)?)\s*(.*)").unwrap();
let string = "Zinaida Shumilina et al. v. Belarus
CCPR/C/120/D/2142/2012
K.E.R. vs. Canada
CCPR/C/120/D/2196/2012
Lounis Khelifati v Algeria
CCPR/C/120/D/2267/2013\"
Hibaq Said Hash v. Denmark
CCPR/C/120/D/2470/2014\"
Anton Batanov v. Russian Federation
CCPR/C/120/D/2532/2015\"
S. Z. v. Denmark
CCPR/C/120/D/2625/2015\"
";
// 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/