0
0

🩹 fix and simplify regex

This commit is contained in:
thetek 2021-04-03 15:46:39 +02:00
parent 08f45e9bd7
commit 0adf3c1513

View File

@ -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);
}