use super::regex::Regex; #[derive(Debug)] pub struct Trait { name: String, value: String, } pub fn parse(s: &str) -> Vec { let reg_trait = Regex::new(r#"(?is)(.*?).*?
(.*?)
"#).unwrap(); reg_trait.captures_iter(s).map(|c| Trait { name: c.at(1).unwrap().into(), value: c.at(2).unwrap().into() }).collect() }