we arent going to download from ftp lol

This commit is contained in:
mykola2312 2024-03-30 06:50:27 +02:00
parent 1fef3288ca
commit 6599410768

View file

@ -3,7 +3,7 @@ use url::Url;
// https://stackoverflow.com/questions/6038061/regular-expression-to-find-urls-within-a-string // https://stackoverflow.com/questions/6038061/regular-expression-to-find-urls-within-a-string
const RE_URL: &str = const RE_URL: &str =
r"(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])"; r"(http|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])";
pub fn extract_url(text: &str) -> Option<&str> { pub fn extract_url(text: &str) -> Option<&str> {
let re = Regex::new(RE_URL).unwrap(); let re = Regex::new(RE_URL).unwrap();