pub fn search_corrections(content: &str) {
let regex_corrections = Regex::new("(\\[\\[)(.*?)(\\|)(.*?)(\\]\\])").unwrap();
for found in regex_corrections.captures_iter(&content) {
println!("{:#?}", found);
}
}
I want to produce next vector at the end of function: first "layer" will be number of matches, like first match equalls vectored[0] etc. While second "layer" equals matches of regex. For example, this function's vectored[0][0] in this context:
pub fn search_corrections(content: &str) {
let mut vector_match: Vec<Vec<&str>> = Vec::new();
let regex_corrections = Regex::new("(\\[\\[)(.*?)(\\|)(.*?)(\\]\\])").unwrap();
for found in regex_corrections.captures_iter(&content) {
let mut vector_temp: Vec<&str> = Vec::new();
for i in 0..6 {
vector_temp.push(found.get(i).unwrap().as_str());
}
vector_match.push(vector_temp);
}
println!("{:#?}", vector_match);
}