proxy-scraper 0.2.0

A Rust command-line tool for scraping proxy information.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use regex::Regex;

/// Separate links from text and return them as a string.
pub fn seperate_links(text: &str) -> String {
    let regex = Regex::new(
        r#"\b(https|ss|vmess|vless|trojan|hysteria2|hy2|hysteria)?://[^\s<>"']+[^.,;!?)"'\s]"#,
    )
    .unwrap();
    let mut links = String::new();
    for cap in regex.captures_iter(text) {
        links.push_str(&cap[0].replace("&amp;amp;", "&").replace("%3D", "="));
        links.push('\n');
    }
    links
}