ip-extract 0.2.0

High-performance IP address extraction and tagging engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use ip_extract::ExtractorBuilder;

fn main() {
    let extractor = ExtractorBuilder::new().build().unwrap();

    let input = b"Link-local with scope: fe80::1%eth0 and fe80::dead:beef%en0";

    let results: Vec<String> = extractor
        .find_iter(input)
        .map(|r| String::from_utf8_lossy(&input[r]).to_string())
        .collect();

    println!("Input: {}", String::from_utf8_lossy(input));
    println!("Results: {:?}", results);
}