comparison libervia/backend/tools/common/regex.py @ 4350:6baea959dc33

component email gateway: convert `autocrypt` header: Autocrypt header must be transmitted in both directions to allow opportunistic end-to-end encryption with this protocol. Moved email validation regex to `tools/common/regex.py`, as it can be used in other locations. rel 456
author Goffi <goffi@goffi.org>
date Fri, 28 Feb 2025 09:23:35 +0100
parents 0d7bb4df2343
children
comparison
equal deleted inserted replaced
4349:1bedcc6712e9 4350:6baea959dc33
29 RE_ANSI_REMOVE = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])") 29 RE_ANSI_REMOVE = re.compile(r"\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])")
30 RE_TEXT_URL = re.compile(r"[^a-zA-Z0-9,_]+") 30 RE_TEXT_URL = re.compile(r"[^a-zA-Z0-9,_]+")
31 TEXT_MAX_LEN = 60 31 TEXT_MAX_LEN = 60
32 # min lenght is currently deactivated 32 # min lenght is currently deactivated
33 TEXT_WORD_MIN_LENGHT = 0 33 TEXT_WORD_MIN_LENGHT = 0
34 # basic email validation
35 RE_EMAIL = re.compile(r"[^@]+@[^@]+\.[^@]+")
34 36
35 37
36 def re_join(exps): 38 def re_join(exps):
37 """Join (OR) various regexes""" 39 """Join (OR) various regexes"""
38 return re.compile("|".join(exps)) 40 return re.compile("|".join(exps))