use rfc 5322 email regex
This commit is contained in:
@@ -86,8 +86,9 @@ pub enum UserEmailError {
|
||||
Empty,
|
||||
}
|
||||
|
||||
static USER_EMAIL_REGEX: LazyLock<Regex> =
|
||||
LazyLock::new(|| Regex::new(r"^[^@]+@[^@]+\.[^@]+$").expect("Email regex"));
|
||||
static USER_EMAIL_REGEX: LazyLock<Regex> = LazyLock::new(|| {
|
||||
Regex::new(r#"^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$"#).expect("Email regex")
|
||||
});
|
||||
|
||||
impl UserEmail {
|
||||
pub fn new(raw: &str) -> Result<Self, UserEmailError> {
|
||||
|
||||
Reference in New Issue
Block a user