// 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)^([\d.]+)\s+([\d:]+)\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)\s+([\d.]+|-\.-)\s+([\d.]+|-\.-)\s+([\d.]+|-\.-)\s+([\w\s()-]+?)\s+(\w+)$").unwrap();
let string = "2021.12.18 22:27:57 36.2620 28.9352 10.5 -.- 3.1 3.2 AKDENIZ Quick
2021.12.18 21:53:20 35.0258 25.7753 5.0 -.- 2.7 -.- GIRIT ADASI ACIKLARI (AKDENIZ) Quick
2021.12.18 21:26:37 36.9778 27.7713 3.8 -.- 1.6 -.- GOKOVA KORFEZI (AKDENIZ) Quick
2021.12.18 20:35:30 37.8640 35.1760 5.4 -.- 1.5 -.- PINARBASI-CAMARDI (NIGDE) Quick
i ne";
// 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/