From da68818d4ff1406f3009f69b77bb689ebec8a9fd Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Tue, 15 Jul 2025 11:13:23 +0900 Subject: [PATCH] Move the domain regex to the regex constant file --- .../check_handling/regex_constants.py | 27 +++++++++++++++++-- .../settings_loader_check.py | 14 +++++----- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/corelibs/check_handling/regex_constants.py b/src/corelibs/check_handling/regex_constants.py index eca6013..f71603e 100644 --- a/src/corelibs/check_handling/regex_constants.py +++ b/src/corelibs/check_handling/regex_constants.py @@ -5,10 +5,33 @@ List of regex compiled strings that can be used import re -EMAIL_REGEX_BASIC = r""" +def compile_re(reg: str) -> re.Pattern[str]: + """ + compile a regex with verbose flag + + Arguments: + reg {str} -- _description_ + + Returns: + re.Pattern[str] -- _description_ + """ + return re.compile(reg, re.VERBOSE) + + +# email regex +EMAIL_BASIC_REGEX = r""" ^[A-Za-z0-9!#$%&'*+\-\/=?^_`{|}~][A-Za-z0-9!#$%:\(\)&'*+\-\/=?^_`{|}~\.]{0,63} @(?!-)[A-Za-z0-9-]{1,63}(?