use super::regex::Regex; pub fn strip_irrelevant_content(s: &str) -> String { let mut retn = ""; match s.find(r#"
"#) { Some(pos) => retn = &s[pos..], None => (), }; match s.find(r#""#) { Some(pos) => retn = &s[..pos], None => (), }; return retn.into(); } pub struct Section { pub name: String, pub re: Regex, pub content: String, } pub fn split_sections(d: &str, s: &mut Vec
) { for section in s { for m in section.re.captures_iter(d) { assert!(m.len() > 1); section.content = format!("{}", m.at(1).unwrap()); } } }