From 0adf3c1513921475bf6763c9eded0e94eaaf5722 Mon Sep 17 00:00:00 2001 From: thetek42 Date: Sat, 3 Apr 2021 15:46:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20fix=20and=20simplify=20regex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/raw/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/raw/index.js b/ui/raw/index.js index 837cda7..16aec4e 100644 --- a/ui/raw/index.js +++ b/ui/raw/index.js @@ -127,7 +127,7 @@ function dnswatch_search() { function is_valid_domain(str) { - let regex = /^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$/; + let regex = /^([a-z0-9\-]+\.)+[a-z0-9]{2,}$/; return regex.test(str); }