Artifact a838fcbd923acfff382403242f369d9c45531264825bf8fca9852642e282378b:
- File src/utils.rs — part of check-in [f5ed284f8c] at 2025-06-21 08:45:52 on branch trunk — refactor, split to modules, change error handling, fix how default destination is specified (user: arcade, size: 474) [annotate] [blame] [check-ins using]
use crate::Cursor; use lazy_static::lazy_static; use regex::Regex; lazy_static! { pub static ref RE_SPECIAL: Regex = Regex::new(r"([\-_*\[\]()~`>#+|{}\.!])").unwrap(); pub static ref RE_DOMAIN: Regex = Regex::new(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$").unwrap(); } /// `Attachment` object to store number attachment data and corresponding file name #[derive(Debug)] pub struct Attachment { pub data: Cursor<Vec<u8>>, pub name: String, }