From cda0133dd1c5876677fa8a45c5924efd6a806b9c Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 21 Dec 2019 11:15:18 +0000 Subject: [PATCH] Revert "Change the regex used for domain validation" This reverts commit 76460f01e9c70905b7ac82d9a294855c6bfd19bc. Signed-off-by: DL6ER --- advanced/Scripts/list.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh index 320d4ae8..4f2e046f 100755 --- a/advanced/Scripts/list.sh +++ b/advanced/Scripts/list.sh @@ -91,8 +91,8 @@ ValidateDomain() { if [[ ( "${typeId}" == "${regex_blacklist}" || "${typeId}" == "${regex_whitelist}" ) && "${wildcard}" == false ]]; then validDomain="${domain}" else - # Use regex to check the validity of the passed domain. see https://regexr.com/3abjr - validDomain=$(grep -P "^((?!-))(xn--)?[a-z0-9][a-z0-9-_]{0,61}[a-z0-9]{0,1}\.(xn--)?([a-z0-9\-]{1,61}|[a-z0-9-]{1,30}\.[a-z]{2,})$" <<< "${domain}") + validDomain=$(grep -P "^((-|_)*[a-z\\d]((-|_)*[a-z\\d])*(-|_)*)(\\.(-|_)*([a-z\\d]((-|_)*[a-z\\d])*))*$" <<< "${domain}") # Valid chars check + validDomain=$(grep -P "^[^\\.]{1,63}(\\.[^\\.]{1,63})*$" <<< "${validDomain}") # Length of each label fi fi