parsenmap 0.1.1

This is a tool for parsing nmap xml file to csv or json
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use regex::Regex;
use xml::attribute::OwnedAttribute;
pub fn get_attr_value_by_name(attrs: &Vec<OwnedAttribute>, name: &str) -> String {
    for attr in attrs {
        if attr.name.to_string() == name {
            let re = Regex::new(r"\n").unwrap();
            let res = re.replace_all(&attr.value, "");
            return res.trim().to_string();
        }
    }
    String::new()
}