// 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"(?x)(?>[^;]*;){5}(?>[^,]*,){2}\s*[^,^\s]*\s*([^,^;]*)(?>[^;^\r^\n]*)").unwrap();
let string = "2009311179;2723088770;Комсомольское отделение филиала ПАО \"ДЭК\"-\"Хабаровскэнергосбыт\";2018-10-23;0de159ee-ebc3-4a1e-81ca-63d8fe5a8558;1093163;Хабаровский край, Солнечный район, п. Хурмули, ул. Школьная, д. 20;;Солнечный;;;421;;Школьная;529;20;;;7;1;16;2012-08-01;65,1;41,3;2012-08-01;3;1;12DEC0701E80601161;;2012-08-01;;Капарушкин;Виталий;Викторович;;;4;4;;2012-08-01";
// 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/