From aa1f9df5e2eb7e23b9b5461a3165da9d7cd500f4 Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Fri, 17 May 2024 16:46:57 +0200 Subject: [PATCH 1/2] [IMP] Use raw string for regex to avoid multiple escaping Also avoid the depreciation warning : invalid escape sequence \. --- roulier/carriers/laposte_fr/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roulier/carriers/laposte_fr/api.py b/roulier/carriers/laposte_fr/api.py index be5c8d2..737c0e6 100644 --- a/roulier/carriers/laposte_fr/api.py +++ b/roulier/carriers/laposte_fr/api.py @@ -314,7 +314,7 @@ def _customs(self): }, "email": { "type": "string", - "regex": "^\\w*@\\w*\.\\w*$", + "regex": r"^\w*@\w*.\w*$", "required": False, "maxlength": 80, }, From 01d9325b3b820db903ee7dafc43fc26e50dcbeca Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 24 May 2024 10:20:48 +0200 Subject: [PATCH 2/2] Update email regex Co-authored-by: Hpar --- roulier/carriers/laposte_fr/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roulier/carriers/laposte_fr/api.py b/roulier/carriers/laposte_fr/api.py index 737c0e6..027be3f 100644 --- a/roulier/carriers/laposte_fr/api.py +++ b/roulier/carriers/laposte_fr/api.py @@ -314,7 +314,8 @@ def _customs(self): }, "email": { "type": "string", - "regex": r"^\w*@\w*.\w*$", + # according to https://emailregex.com/ + "regex": r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)", "required": False, "maxlength": 80, },