// 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"(?:[\.\d]+\,[\.\d]+\s*?){5,5}").unwrap();
let string = "<path d=\"M 15.43,29.45 C 23.73,28.89 38,25.96 44.2,25.42 46.48,25.22 47.41,27 47.16,29.29 46.59,34.67 45.5,46 44.14,53.63\"/>
<path d=\"M 16.91,41.07 C 19.61,40.8 36.25,38.5 45.64,37.7\"/>";
// 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/