From 46b49d588d65d7ce8a9052b8d3a4038ace9342c9 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Fri, 17 Nov 2023 00:26:45 +1100 Subject: [PATCH] fix: Check correct form value for regex --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index f992473..d785d7c 100644 --- a/main.py +++ b/main.py @@ -104,7 +104,7 @@ def add_link(): if not (url.startswith('http://') or url.startswith('https://')): url = 'https://' + url - regexmatch = re.match(r"^https?://([a-z0-9]+(-[a-z0-9]+)*\.)*([a-z0-9]+(-[a-z0-9]+)*)(/([a-z0-9.])+(-([a-z0-9.])+)?)*$", domain) + regexmatch = re.match(r"^https?://([a-z0-9]+(-[a-z0-9]+)*\.)*([a-z0-9]+(-[a-z0-9]+)*)(/([a-z0-9.])+(-([a-z0-9.])+)?)*$", url) if not regexmatch: return error('Invalid domain')