1mod ascii_table;
2mod encoder_task;
3mod loading_reaction;
4mod timed_cache;
5
6pub use self::{
7 ascii_table::AsciiTable,
8 encoder_task::EncoderTask,
9 loading_reaction::LoadingReaction,
10 timed_cache::{
11 TimedCache,
12 TimedCacheEntry,
13 },
14};
15use once_cell::sync::Lazy;
16use regex::Regex;
17use url::Url;
18
19static URL_REGEX: Lazy<Regex> =
21 Lazy::new(|| Regex::new(include_str!("url_regex.txt")).expect("invalid url regex"));
22
23pub fn extract_urls(text: &str) -> impl Iterator<Item = Url> + '_ {
25 URL_REGEX
28 .find_iter(text)
29 .filter_map(|url_match| Url::parse(url_match.as_str()).ok())
30}