From 54784e352a2f80963bd5d313421cb0c42d3a401a Mon Sep 17 00:00:00 2001 From: Jan Lesage Date: Wed, 7 Feb 2024 09:37:21 +0100 Subject: [PATCH] fix: or-2088 replace email validation regular expression to be less restrictive --- .../Vereniging/ContactGegevens/Emails/Email.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AssociationRegistry/Vereniging/ContactGegevens/Emails/Email.cs b/src/AssociationRegistry/Vereniging/ContactGegevens/Emails/Email.cs index ad84f16c9..9a5c6682a 100644 --- a/src/AssociationRegistry/Vereniging/ContactGegevens/Emails/Email.cs +++ b/src/AssociationRegistry/Vereniging/ContactGegevens/Emails/Email.cs @@ -9,9 +9,9 @@ public record Email(string Waarde, string Beschrijving, bool IsPrimair) { public static readonly Email Leeg = new(string.Empty, string.Empty, IsPrimair: false); - private static readonly Regex EmailRegex = new( - pattern: @"^([_-]*([a-z0-9]+[\.!#$%&'*+/=?^_`{|}~-]?){1,}[_-]*)@(([a-z0-9]+[\.-]?)*[a-z0-9]\.)+[a-z]{2,}$", - RegexOptions.IgnoreCase); + private static readonly Regex EmailRegex = + new(pattern: @"^([_-]*([a-z0-9]+[\.!#$%&'*+/=?^_`{|}~-]?){1,}[_-]*)@(([a-z0-9]+[\.-]?)*[a-z0-9]\.)+[a-z]{2,}$", + RegexOptions.IgnoreCase); public static Email Create(string? email) => Create(email, string.Empty, isPrimair: false);